/*
 * style.css
 * 观赏鱼收藏记录网站 - 完整样式表 (CSS3, Flexbox & Grid)
 */

:root {
    --primary-color: #006994; /* 深海蓝 */
    --secondary-color: #2c3e50; /* 深灰蓝 */
    --accent-color: #f39c12; /* 琥珀色 */
    --bg-color: #f4f7f6; /* 浅背景 */
    --card-bg: #ffffff;
    --text-color: #333;
    --danger-color: #c0392b; /* 红色 */
    --success-color: #27ae60; /* 绿色 */
}

/* =========================================================================
 * 基础布局与排版
 * ========================================================================= */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    line-height: 1.6;
}

h1, h2, h3 { color: var(--secondary-color); margin-top: 0; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* =========================================================================
 * 导航栏与搜索 (前端/公共画廊)
 * ========================================================================= */

.navbar {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 0;
    margin-bottom: 30px;
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}
.nav-links a {
    margin-left: 20px;
    font-weight: 500;
    color: var(--secondary-color);
}
.nav-links a:hover { color: var(--primary-color); }

/* 搜索框 */
.search-bar {
    max-width: 600px;
    margin: 0 auto 30px auto;
    display: flex;
    gap: 10px;
}
.search-bar input {
    flex-grow: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    transition: 0.3s;
}
.search-bar input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 105, 148, 0.1);
}

/* =========================================================================
 * 按钮与表单
 * ========================================================================= */

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s, transform 0.1s;
}
.btn:hover { 
    background-color: #005070; 
    transform: translateY(-1px);
}
.btn-danger { 
    background-color: var(--danger-color); 
    font-size: 0.9rem; 
    padding: 8px 15px;
}
.btn-danger:hover {
    background-color: #922b21;
}

.form-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 40px auto;
}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input, 
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box; 
    font-size: 1rem;
}
.form-group input[type="file"] { border: none; padding-left: 0; }

/* =========================================================================
 * 后台管理布局 (Admin Layout)
 * ========================================================================= */

.admin-layout { 
    display: flex; 
    min-height: 100vh; 
}

.sidebar { 
    width: 260px; 
    background: var(--secondary-color); 
    color: white; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-header { 
    padding: 20px; 
    text-align: center; 
    background: #243342; 
    border-bottom: 1px solid #3c5166;
}
.sidebar-header h3 { color: white; margin-bottom: 5px; }

.sidebar-menu { 
    padding: 10px; 
    flex-grow: 1; 
}

.sidebar-menu a { 
    display: block; 
    padding: 12px; 
    color: #ecf0f1; 
    border-radius: 4px; 
    margin-bottom: 5px;
    font-size: 0.95rem;
}
.sidebar-menu a:hover, 
.sidebar-menu a.active { 
    background: var(--primary-color); 
}

.content { 
    flex: 1; 
    padding: 30px; 
    overflow-y: auto; 
}

/* =========================================================================
 * 徽章与标签 (Badges)
 * ========================================================================= */

.badge { 
    padding: 3px 8px; 
    border-radius: 10px; 
    font-size: 0.8em; 
    color: white; 
    margin-left: 5px;
    font-weight: bold;
}
.badge-super { background: #8e44ad; } /* 紫色 */
.badge-security { background: var(--danger-color); } /* 红色 */
.badge-audit { background: var(--accent-color); } /* 琥珀色 */
.badge-system { background: #3498db; } /* 蓝色 */
.badge-user { background: var(--success-color); } /* 绿色 */

/* =========================================================================
 * 鱼卡片展示 (Fish Card)
 * ========================================================================= */

.fish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.fish-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fish-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.fish-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}
.fish-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #eee;
    transition: transform 0.5s ease;
}
.fish-card:hover .fish-img {
    transform: scale(1.1); /* 图片放大效果 */
}

.fish-info {
    padding: 15px;
    flex-grow: 1;
}

.fish-info h3 { margin: 0 0 5px; color: var(--secondary-color); }
.fish-meta { font-size: 0.9rem; color: #666; margin-bottom: 5px; }
.fish-price { color: var(--success-color); font-weight: bold; font-size: 1.1rem; }
.fish-price-tag { color: var(--success-color); font-weight: bold; font-size: 1.1rem; }

/* 额外标签 */
.owner-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
    z-index: 10;
}
.fish-date {
    color: #999;
    font-size: 0.85rem;
}

/* =========================================================================
 * 表格样式 (Audit Logs & User List)
 * ========================================================================= */

table { 
    width: 100%; 
    border-collapse: collapse; 
    background: white; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

th, td { 
    padding: 12px; 
    border-bottom: 1px solid #eee; 
    text-align: left; 
    font-size: 0.95rem;
}

th { 
    background: #e9ecef; 
    font-weight: 600;
    color: #495057;
}

tr:last-child td { border-bottom: none; }

/* 策略管理页特有样式 */
.policy-card { 
    background: #fff; 
    padding: 20px; 
    border-left: 5px solid var(--accent-color); 
    margin-bottom: 20px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    border-radius: 5px;
}
.input-group { 
    margin-bottom: 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 5px 0;
}
.input-group label { 
    font-weight: bold; 
    color: #34495e; 
    width: 60%;
}
.input-group input { 
    padding: 8px; 
    width: 120px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    text-align: right;
}
.hint { 
    font-size: 0.85em; 
    color: #7f8c8d; 
    display: block; 
    margin-top: 5px; 
    font-weight: normal !important;
}

/* 统计卡片样式 */
.stats-card {
    background:linear-gradient(135deg, #006994, #2c3e50); 
    color:white; 
    padding:25px; 
    border-radius:8px; 
    margin-bottom:30px; 
    display:flex; 
    justify-content:space-between; 
    align-items:center;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}
.stats-card h1, .stats-card h2 { color: white; }