*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f5f5f7;
    --surface: #fafafa;
    --border: #e8e8ed;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #aeaeb2;
    --accent: #1d1d1f;
    --green: #34c759;
    --green-light: #eaf7ee;
    --danger: #ff3b30;
    --radius: 16px;
    --radius-sm: 10px;
    --nav-h: 48px;            /* 导航栏（banner）高度，高分屏自适应放大 */
    --nav-logo-h: 24px;       /* 导航 logo 高度 */
    --nav-trigger-fs: 14px;   /* 导航文字大小 */
    --content-w: 1100px;      /* 内容区与 banner 共用宽度，保证 logo/图标与内容外边界对齐 */
    --page-top: calc(var(--nav-h) + 52px);   /* 页面顶部留白（导航 + 余量） */
}

body {
    font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

/* ============================================
   Navigation — 极简
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    z-index: 1000;
    background: #fff;
    border-bottom: none;
}
.nav-inner {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--nav-h);
    position: relative;
}
.nav-left { position: absolute; left: 32px; display: flex; align-items: center; }
.nav-center { display: flex; align-items: center; gap: 4px; }
.nav-right { position: absolute; right: 32px; display: flex; align-items: center; }
.nav-trigger {
    font-size: var(--nav-trigger-fs);
    font-weight: 600;
    color: var(--text);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    outline: none;
    line-height: 20px;   /* 按钮/链接盒子统一高度 */
    min-width: 53px;      /* 统一宽度（2 个汉字 + 内边距） */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.nav-trigger:hover { background: rgba(0,0,0,0.06); }
.nav-logo { height: var(--nav-logo-h); display: block; }
.nav-right-links { display: flex; align-items: center; gap: 16px; }
.nav-right-links a { font-size: 12px; color: var(--text-secondary); text-decoration: none; }
.nav-right-links a:hover { opacity: 0.6; }
/* .nav-right-links a.btn-primary 已移除 — 被下方 nav-btn-icon 规则替代 */
.nav-icon { display: none; }

/* ---- 导航栏图标按钮（桌面端） ---- */
.nav-btn-icon { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: none; color: var(--text-secondary); width: 30px; height: 30px; padding: 0; line-height: 0; position: relative; }
.nav-btn-icon .nav-icon { display: block; width: 17px; height: 17px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.nav-btn-icon .nav-label { display: none; }
/* 桌面端「纳新」：黑色实心圆 26px，加号图标 15px（游客登录图标保持 30px 描边样式） */
@media (min-width: 769px) {
    .nav:not(.nav-guest) .nav-right-links .nav-btn-icon.btn-primary { background: var(--accent); color: #fff; width: 26px; height: 26px; }
    .nav:not(.nav-guest) .nav-right-links .nav-btn-icon.btn-primary .nav-icon { width: 15px; height: 15px; }
    .nav:not(.nav-guest) .nav-right-links .nav-btn-icon.btn-primary:hover { opacity: 0.85; }
}
.nav-right-links .nav-btn-icon:not(.btn-primary) { width: 24px; height: 24px; opacity: 0.35; }
.nav-right-links .nav-btn-icon:not(.btn-primary):hover { opacity: 0.6; }
/* 桌面：账号入口用可点击的用户名，账号图标隐藏 */
.nav-btn-icon.nav-account-icon { display: none; }
.nav-username:hover { opacity: 0.7; }
.nav.nav-guest .nav-btn-icon.btn-primary { background: transparent; color: var(--text-secondary); border: 1px solid var(--text-tertiary); }
.nav.nav-guest .nav-btn-icon.btn-primary:hover { background: rgba(0,0,0,0.04); }

/* 下拉面板 */
.nav-dropdown {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    border-bottom: none;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.3s ease;
}
.nav-dropdown.active {
    max-height: 900px;
    opacity: 1;
    pointer-events: auto;
}
.nav-dropdown-inner {
    --dd-gap: 20px;            /* 顶部留白 / 两行间距 / 底部留白 统一为这一个值 */
    max-width: var(--content-w);
    margin: 0 auto;
    padding: var(--dd-gap) 32px var(--dd-gap);   /* 左右 32px 与 banner 两端图标对齐 */
    display: grid;
    grid-template-columns: repeat(5, 1fr);       /* 第一行固定 5 张，均分对齐 */
    gap: var(--dd-gap);
}
.nav-species-card {
    display: block;
    width: auto;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.nav-species-card:hover { transform: scale(1.05); }
.nav-species-card .nav-species-media { width: 100%; height: 130px; display: block; }
.nav-species-card .nav-species-label { padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--text); text-align: center; }

/* 遮罩层 */
.nav-overlay {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.nav-overlay.active { opacity: 1; pointer-events: auto; }

/* ============================================
   高分辨率大屏（≥2200px 逻辑宽度，2K/4K）：banner 随视口自适应放大。
   1080p（1920px）不命中，保持原 48px 布局不变。
   ============================================ */
@media (min-width: 2200px) {
    :root {
        --nav-h: clamp(62px, 2.9vw, 100px);
        --nav-logo-h: clamp(31px, 1.4vw, 50px);
        --nav-trigger-fs: clamp(17px, 0.8vw, 27px);
        --content-w: clamp(1320px, 60vw, 1800px);
    }
    .nav-trigger { padding: 10px 20px; min-width: 70px; line-height: 28px; }
    .nav-right-links { gap: 24px; }
    .nav-btn-icon { width: 46px; height: 46px; }
    .nav-btn-icon .nav-icon { width: 25px; height: 25px; }
}

/* ============================================
   Hero Sections — Apple 无边界风格
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 图片背景 Hero */
.hero-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.35) 100%);
}
.hero-overlay-dark {
    background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.55) 100%);
}

/* 纯色/渐变 Hero */
.hero-gradient {
    background: linear-gradient(180deg, #1d1d1f 0%, #2d2d2f 100%);
}

/* ============================================
   Hero 照片轮播墙
   ============================================ */
.hero-carousel {
    position: relative;
}
.carousel-stage {
    position: absolute;
    inset: 0;
    z-index: 1;
}
/* ---- Photo Wall Grid (styles now in index.html inline) ---- */

/* ---- Carousel (legacy, kept for reference) ---- */
.carousel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
}

/* Hero 内容 */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 80px 32px;
    max-width: 900px;
}

/* Hero 标题层级 */
.hero-title {
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #fff;
    margin-bottom: 4px;
}
.hero-sub {
    font-size: clamp(24px, 4vw, 48px);
    font-weight: 600;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.8);
    margin-bottom: 24px;
}
.hero-desc {
    font-size: 18px;
    font-weight: 400;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.02em;
}
.hero-desc strong {
    color: #fff;
    font-weight: 600;
}

.hero-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 40px;
}

/* Hero 数据统计 */
.hero-stats {
    display: flex;
    gap: clamp(40px, 6vw, 80px);
    justify-content: center;
    align-items: baseline;
    margin-bottom: 32px;
}
.hero-stat {
    text-align: center;
}
.hero-stat-num {
    display: block;
    font-size: clamp(56px, 10vw, 120px);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    color: #fff;
}
.hero-stat-label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    margin-top: 8px;
    letter-spacing: 0.04em;
}

/* Hero 品种分布 */
.hero-species {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 48px;
    justify-content: center;
}
.hero-species-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-species-name {
    font-size: 18px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
}
.hero-species-count {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1.1;
}

/* Hero 喂食列表 */
.hero-feed-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;
}
.hero-feed-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 0.5px solid rgba(0,0,0,0.1);
}
.hero-gradient-invert .hero-feed-item,
.hero-gradient .hero-feed-item {
    border-bottom-color: rgba(255,255,255,0.1);
}
.hero-feed-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}
.hero-gradient-invert .hero-feed-name,
.hero-gradient .hero-feed-name {
    color: #fff;
}
.hero-feed-detail {
    font-size: 14px;
    color: var(--text-secondary);
}
.hero-gradient-invert .hero-feed-detail,
.hero-gradient .hero-feed-detail {
    color: rgba(255,255,255,0.5);
}
.hero-feed-date {
    font-size: 13px;
    color: var(--text-tertiary);
}
.hero-gradient-invert .hero-feed-date,
.hero-gradient .hero-feed-date {
    color: rgba(255,255,255,0.35);
}

/* Hero 库存 */
.hero-inventory {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 40px;
    justify-content: center;
}
.hero-inv-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-inv-group {
    font-size: 18px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
}
.hero-inv-range {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    margin: 4px 0 8px;
}
.hero-inv-stock {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

/* ============================================
   Snake Grid Section
   ============================================ */
.snakes-section {
    padding: 80px 32px 60px;
    max-width: var(--content-w);
    margin: 0 auto;
    background: var(--bg);
}
.section-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 32px;
    text-align: center;
}

.snake-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.snake-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.25s ease;
}
.snake-card:hover {
    transform: translateY(-3px);
}
.snake-card-img {
    height: 180px;
    background: #f0f0f2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.snake-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.snake-card-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f0f0f2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.snake-card-placeholder img {
    width: 36px;
    height: 36px;
    opacity: 0.25;
}
.snake-card-body {
    padding: 16px 18px 18px;
}
.snake-card-body .card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.snake-card-body .card-top h3 {
    margin-bottom: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.snake-card-body .card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    min-width: 0;
}
.snake-card-body .card-bottom .species {
    margin-bottom: 0;
    flex: 0 0 auto;   /* 品种永不压缩，完整显示 */
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}
.snake-card-body .card-bottom .tag-row {
    flex: 0 1 auto;
    min-width: 0;
}
.snake-card-body .card-bottom .tag-morph {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.snake-card-body .card-bottom .tag-sex {
    flex-shrink: 0;
}
.snake-card-body h3 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.snake-card-body .species {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.tag-row { display: flex; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}
.tag-morph { background: var(--green-light); color: var(--green); }
.tag-sex { background: #f5f5f7; color: var(--text-secondary); }

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-tertiary);
}
.empty-state p { font-size: 15px; margin-top: 16px; }

/* ============================================
   Container (for inner pages)
   ============================================ */
.container { max-width: var(--content-w); margin: 0 auto; padding: 0 28px; }

/* ============================================
   Page Header
   ============================================ */
.page-header {
    padding: 60px 0 48px;
    text-align: center;
}
.page-header h1 {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
}
.page-header .sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 400;
}

/* ============================================
   Detail Page
   ============================================ */
.back-link {
    display: inline-block;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 0;
    transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

.detail-header {
    padding: 28px 0 32px;
}
.detail-header h1 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.snake-info {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    margin: 10px 0 6px;
    font-size: 13px;
    color: var(--text-secondary);
}
.snake-info .tag { font-size: 12px; }
.detail-notes {
    color: var(--text-tertiary);
    font-size: 14px;
    font-style: italic;
    margin: 8px 0 16px;
}
.btn-delete {
    background: none;
    border: none;
    color: var(--danger);
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-delete:hover { background: var(--danger); color: #fff; }

/* Record Section */
.record-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
}
.record-section h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}

.record-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}
.record-form input,
.record-form select {
    padding: 9px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: #f5f5f7;
    color: var(--text);
    outline: none;
    transition: background 0.2s;
}
.record-form input:focus,
.record-form select:focus { background: #ededf0; }
.record-form input[type="date"] { width: 140px; }
.record-form input[type="number"] { width: 110px; }
.record-form input[type="text"] { width: 160px; }
.record-form select {
    width: 130px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2386868b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.354a.5.5 0 01.708 0L8 8.293l2.646-1.94a.5.5 0 01.708.708l-3 2.5a.5.5 0 01-.708 0l-3-2.5a.5.5 0 010-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 9px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3a3a3c; transform: scale(1.02); }
.btn-danger { background: none; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 11px; border-radius: 14px; }

/* Tables */
.record-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.record-table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.record-table td {
    padding: 12px 14px;
    border-bottom: none;
}
.record-table tr:nth-child(even) td {
    background: var(--surface);
}
.record-table tr:nth-child(odd) td {
    background: #fff;
}
.record-table tr:last-child td { border-bottom: none; }
.text-danger { color: var(--danger); font-weight: 600; }
.empty-hint { text-align: center; color: var(--text-tertiary); padding: 24px 0; font-size: 13px; }

/* Form Page */
.form-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 560px;
    margin: 0 auto;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 7px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: #f5f5f7;
    color: var(--text);
    outline: none;
    transition: background 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    background: #ededf0;
}
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2386868b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.354a.5.5 0 01.708 0L8 8.293l2.646-1.94a.5.5 0 01.708.708l-3 2.5a.5.5 0 01-.708 0l-3-2.5a.5.5 0 010-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.btn-block { width: 100%; padding: 14px; border-radius: var(--radius-sm); font-size: 15px; }

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0 60px;
    background: var(--bg);
}
.footer-inner {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;   /* 中间 auto 列 = logo 绝对居中 */
    align-items: center;
    gap: 28px;
}
.footer img {
    height: 24px;
    opacity: 0.2;
}
.footer .footer-slogan {
    margin: 0;
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: right;          /* 贴向 logo */
    white-space: nowrap;
}
.footer .footer-icp {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.02em;
    text-align: left;           /* 贴向 logo */
    white-space: nowrap;
}
.footer .footer-icp a {
    color: var(--text-tertiary);
    text-decoration: none;
}
.footer .footer-icp a:hover { opacity: 0.7; }

/* ============================================
   Responsive — Mobile (<768px)
   ============================================ */
@media (max-width: 768px) {
    /* 顶部留白：游客导航 70px / 管理员导航 120px，统一加 20px 余量 */
    :root { --page-top: calc(70px + 20px); }
    body:not(.nav-guest-mode) { --page-top: calc(120px + 20px); }

    /* ---- 通用：padding 减半 ---- */
    .container { padding: 0 12px; }
    .snakes-section { padding: 40px 12px 32px; }

    /* ---- 通用：按钮和输入框最小 44px 高度 ---- */
    .btn { min-height: 44px; padding: 10px 18px; font-size: 14px; }
    .btn-sm { min-height: 32px; padding: 4px 12px; font-size: 12px; }
    .form-group input,
    .form-group select,
    .form-group textarea { min-height: 44px; padding: 11px 14px; font-size: 16px; }
    .record-form input,
    .record-form select { min-height: 44px; padding: 10px 14px; font-size: 14px; }
    .btn-block { min-height: 48px; font-size: 16px; }

    /* ---- 导航栏 ---- */
    .nav { height: 120px; }
    .nav-inner { height: 120px; padding: 0 16px; }
    .nav-left { left: 16px; top: 50%; transform: translateY(-50%); }
    .nav-right { right: 16px; top: 50%; transform: translateY(-50%); }
    .nav-center { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 4px; align-content: center; height: 100%; }
    .nav-trigger { font-size: 18px; padding: 10px 20px; text-align: center; line-height: 25px; }
    .nav-right-links { gap: 0; position: static; }
    /* 移动端空间有限：隐藏用户名，改用账号图标入口 */
    .nav-username { display: none; }
    .nav-right-links a { font-size: 17px; }
    .nav-right-links a.btn-primary { padding: 10px 20px; font-size: 17px; }
    .nav-icon { display: block; }
    .nav-label { display: none; }
    .nav-btn-icon { display: flex !important; align-items: center; justify-content: center; padding: 0 !important; border-radius: 50% !important; position: absolute; top: 50%; transform: translateY(-50%); }
    /* 添加图标：与左侧 logo 对称 */
    .nav-btn-icon.btn-primary { width: 36px; height: 36px; right: 8px; background: var(--accent); color: #fff; }
    .nav-btn-icon.btn-primary:hover { transform: translateY(-50%); background: #3a3a3c; }
    /* 退出图标：弱化，放在添加图标左侧 */
    .nav-btn-icon:not(.btn-primary) { width: 28px; height: 28px; right: 52px; opacity: 0.35; color: var(--text-secondary); }
    /* 纳新/编辑页：纳新按钮隐藏时，退出图标右移到纳新原位置 */
    .nav-no-add .nav-btn-icon:not(.btn-primary) { right: 8px; }
    .nav-btn-icon:not(.btn-primary):hover { opacity: 0.6; }
    /* 账号图标：放在退出图标左侧（移动端用户名隐藏时的入口） */
    .nav-btn-icon.nav-account-icon { display: flex !important; position: absolute; top: 50%; transform: translateY(-50%); right: 52px; width: 28px; height: 28px; opacity: 0.5; color: var(--text-secondary); }
    .nav-btn-icon.nav-account-icon:hover { opacity: 0.8; }
    .nav-no-add .nav-btn-icon.nav-account-icon { right: 8px; }
    /* 上移 1px 与导航重叠，避免 Safari 两固定层间的 1px 缝隙线 */
    .nav-dropdown { top: 119px; }
    .nav-dropdown-inner { padding: 24px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
    .nav-species-card { width: auto; }
    .nav-species-card .nav-species-media { height: 100px; }
    /* 「所有蛇」卡片（内联 130px）：移动端与其他卡片等高 */
    .nav-species-card .nav-all-snakes-media { height: 100px !important; }
    .nav-species-card .nav-species-label { font-size: 13px; padding: 10px 12px; }
    .nav-overlay { top: 120px; }

    /* 未登录时导航栏减半高度 */
    .nav.nav-guest { height: 70px; }
    .nav.nav-guest .nav-inner { height: 70px; }
    .nav-guest-mode .nav-dropdown { top: 69px; }
    .nav-guest-mode .nav-dropdown-inner { padding-top: 0; padding-bottom: 24px; }
    .nav-guest-mode .nav-overlay { top: 70px; }
    .nav.nav-guest .nav-center { display: flex; gap: 4px; }
    .nav.nav-guest .nav-btn-icon.btn-primary { width: 36px; height: 36px; right: 8px; background: none; color: var(--text-secondary); border: 1.5px solid var(--text-tertiary); }
    .nav-btn-icon .nav-icon { width: 20px; height: 20px; }
    .nav-guest-mode .nav-species-card .nav-species-media { height: 100px !important; }

    /* 手机端隐藏 logo 文字，只保留图标 */
    .nav-left a img.nav-logo {
        content: url('/static/logo-circle.png');
        height: 48px;
        width: 48px;
    }

    /* ---- Hero ---- */
    .hero-content { padding: 40px 16px; }
    .hero-title { font-size: clamp(28px, 10vw, 48px); }
    .hero-sub { font-size: clamp(16px, 5vw, 28px); }
    .hero-desc { font-size: 14px; }
    .hero-label { font-size: 11px; margin-bottom: 24px; }
    .hero-stats { gap: 20px; }
    .hero-stat-num { font-size: clamp(36px, 12vw, 64px); }
    .hero-stat-label { font-size: 12px; }
    .hero-species { gap: 16px 24px; }
    .hero-species-name { font-size: 14px; }
    .hero-species-count { font-size: 32px; }

    /* ---- Snake Grid —— 2 列 ---- */
    .snake-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .snake-card-img { height: 140px; }
    .snake-card-body { padding: 12px 14px 14px; }
    .snake-card-body h3 { font-size: 14px; }

    /* ---- 详情页 ---- */
    .detail-wrap { padding: 60px 12px 40px; }

    /* ---- Page Header ---- */
    .page-header { padding: 40px 0 48px; }
    .page-header h1 { font-size: 28px; }
    .page-header .sub { font-size: 13px; }

    /* ---- Form Card ---- */
    .form-card { padding: 20px 16px; }
    .form-row { flex-direction: column; gap: 0; }

    /* ---- Record Section ---- */
    .record-section { padding: 20px 16px; }
    .record-section h2 { font-size: 17px; }
    .record-form { flex-direction: column; }
    .record-form input[type="date"],
    .record-form input[type="number"],
    .record-form input[type="text"] { width: 100%; }

    /* ---- 速调表格横向滚动 & 字体缩小 ---- */
    .tune-table { font-size: 11px; }
    .tune-table th { font-size: 10px; padding: 8px 6px; }
    .tune-table td { padding: 8px 6px; font-size: 11px; }
    .tune-table select { font-size: 11px; padding: 5px 22px 5px 6px; }
    .tune-table input[type="number"] { font-size: 11px; width: 56px; padding: 5px 6px; }
    .btn-save { font-size: 10px; padding: 5px 10px; }

    /* ---- Footer ---- */
    .footer { padding: 32px 0 48px; }
    .footer-inner { padding: 0 16px; gap: 16px; }
    .footer img { height: 18px; }
    .footer .footer-slogan, .footer .footer-icp { font-size: 11px; }
}

/* ============================================
   Responsive — Small Phone (<480px)
   ============================================ */
@media (max-width: 480px) {
    .snake-grid { grid-template-columns: repeat(2, 1fr); }
    .snake-card-img { height: 120px; }
    .snake-card-body h3 { font-size: 13px; }
    .tune-table { font-size: 10px; }
}

/* ============================================
   隐藏页面右侧滚动条（页面仍可正常滚动）
   ============================================ */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; }

/* ============================================
   高分辨率大屏（≥2200px）：内容比例整体自适应
   用 body 前缀提升特异性，压过各页面模板里的内联 <style>
   ============================================ */
@media (min-width: 2200px) {
    /* ---- 内容容器加宽：随 --content-w 统一变化（喂养页 fc-wrap 例外，保持窄表单） ---- */
    body .fc-wrap { max-width: clamp(900px, 40vw, 1200px); }
    body .hero-content { max-width: clamp(900px, 45vw, 1300px); }

    /* ---- 页面标题与副标题 ---- */
    body .snakes-header h1, body .seeking-header h1, body .dash-header h1,
    body .fc-header h1, body .page-header h1 {
        font-size: clamp(52px, 2.1vw, 72px);
    }
    body .snakes-header p, body .seeking-header p, body .dash-header p,
    body .fc-header p, body .page-header .sub {
        font-size: clamp(16px, 0.7vw, 21px);
    }

    /* ---- 家族 / 寻觅 瀑布流：列更宽 ---- */
    body .snake-grid {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: clamp(26px, 1.3vw, 38px);
    }
    body .snake-thumb { height: clamp(230px, 10.5vw, 320px); }
    body .snake-card-body h3 { font-size: clamp(19px, 0.85vw, 25px); }
    body .snake-card-body .species { font-size: clamp(14px, 0.65vw, 18px); }
    body .tag, body .tag-morph, body .tag-sex { font-size: clamp(13px, 0.6vw, 17px); }
    body .filter-bar a { font-size: clamp(13px, 0.6vw, 16px); padding: 7px 16px; }
    body .price-tag { font-size: clamp(15px, 0.7vw, 19px); padding: 5px 16px; }

    /* ---- 详情页 ---- */
    body .unified-card-right h2 { font-size: clamp(32px, 1.5vw, 44px); }
    body .unified-card-right .info-row { font-size: clamp(15px, 0.7vw, 20px); }
    body .record-section h3 { font-size: clamp(20px, 0.9vw, 26px); }
    body .record-table { font-size: clamp(13px, 0.6vw, 17px); }
    body .record-table th { font-size: clamp(12px, 0.55vw, 16px); }
    body .comment-body { font-size: clamp(15px, 0.7vw, 19px); }

    /* ---- 家族下拉面板：5 列均分自动拉宽，两端与 banner 对齐 ---- */
    body .nav-dropdown-inner { --dd-gap: clamp(22px, 1.3vw, 32px); }
    body .nav-species-card .nav-species-media { height: 180px; }
    body .nav-species-card .nav-species-label { font-size: 17px; padding: 14px 16px; }
}
