/* ========================================
   唐卡会员主题 - 主样式表
   ======================================== */

/* --- 重置与全局 --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #333;
    background: #f7f5f2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #8B3A2C; text-decoration: none; transition: color 0.2s; }
a:hover { color: #D2691E; }

img { max-width: 100%; height: auto; }

/* --- 顶部导航 --- */
.site-header {
    background: linear-gradient(135deg, #6B2818 0%, #8B3A2C 50%, #a24434 100%);
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 16px rgba(92, 46, 14, 0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
}

.site-logo a {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo a::before {
    content: '';
    display: inline-block;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    background-image: url('../images/icon-bird.jpg');
    background-size: cover;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
}

.nav-menu a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.nav-menu .btn-outline {
    border: 1.5px solid rgba(255,255,255,0.5);
    padding: 6px 18px;
}

.nav-menu .btn-outline:hover {
    background: rgba(255,255,255,0.2);
    border-color: #fff;
}

/* 移动端汉堡菜单 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* --- 主体容器 --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-main {
    flex: 1;
    padding: 40px 0;
}

/* --- 页面头部 --- */
.page-header {
    text-align: center;
    padding: 48px 24px 32px;
}

.page-header h1 {
    font-size: 2rem;
    color: #6B2818;
    margin-bottom: 8px;
}

.page-header p {
    color: #888;
    font-size: 1.05rem;
}

/* --- 卡片 --- */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    padding: 28px;
    border: 1px solid #ede7df;
}

/* --- 按钮系统 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.4;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, #8B3A2C, #a24434);
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #7A3B10, #8B3A2C);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 58, 44, 0.3);
}

.btn-success { background: #28a745; color: #fff; }
.btn-success:hover:not(:disabled) { background: #218838; }

.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #c82333; }

.btn-outline {
    background: transparent;
    border: 1.5px solid #8B3A2C;
    color: #8B3A2C;
}
.btn-outline:hover { background: #8B3A2C; color: #fff; }

.btn-sm { padding: 4px 12px; font-size: 0.8rem; border-radius: 6px; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

/* --- 表单 --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #999;
    font-size: 0.8rem;
}

.form-control,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafaf8;
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8B3A2C;
    box-shadow: 0 0 0 3px rgba(139, 58, 44, 0.08);
    background: #fff;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 400 !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8B3A2C;
}

/* --- 消息提示 --- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: #e6f4ea; color: #1e7e34; border: 1px solid #b7dfc2; }
.alert-error   { background: #fce8ea; color: #c62828; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff8e5; color: #b85c00; border: 1px solid #ffe7a5; }
.alert-info    { background: #e3f0fc; color: #0d5fa7; border: 1px solid #b8d8f8; }

/* --- 进度条 --- */
.progress-container {
    background: #e9e5df;
    border-radius: 20px;
    overflow: hidden;
    height: 28px;
    margin: 12px 0 20px;
}

.progress-bar {
    background: linear-gradient(90deg, #8B3A2C, #D2691E);
    height: 100%;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    min-width: 40px;
}

/* --- 表格 --- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table thead th {
    background: #f5f2ed;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: #6B2818;
    border-bottom: 2px solid #ddd;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #ede7df;
}

.table tbody tr:hover { background: #fdfcfa; }

/* --- 加载动画 --- */
.loading {
    text-align: center;
    padding: 32px;
    color: #999;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2.5px solid #ddd;
    border-top-color: #8B3A2C;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- 认证页面 (登录/注册) --- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
    padding: 40px 20px;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 40px;
    width: 100%;
    max-width: 440px;
}

.auth-card h2 {
    text-align: center;
    color: #6B2818;
    margin-bottom: 8px;
    font-size: 1.6rem;
}

.auth-card .subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.auth-card .form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #888;
    font-size: 0.9rem;
}

/* --- 页脚 --- */
.site-footer {
    background: #3E1F0D;
    color: rgba(255,255,255,0.7);
    padding: 24px 0;
    text-align: center;
    font-size: 0.85rem;
    margin-top: auto;
}

.site-footer a { color: rgba(255,255,255,0.9); }

/* --- 首页浮动页脚 --- */
.hero-footer {
    position: absolute;
    bottom: 24px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    z-index: 2;
    line-height: 1.8;
}
.hero-footer a { color: rgba(255, 255, 255, 0.5); }
.hero-footer a:hover { color: rgba(255, 255, 255, 0.8); }

/* --- 响应式 --- */
/* ========================================
   首页英雄区域
   ======================================== */

/* --- 英雄容器 --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2070') no-repeat center center fixed;
    background-size: cover;
    overflow: hidden;
}

/* --- 暗色叠加层 --- */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 20, 10, 0.6);
    z-index: 1;
}

/* --- 内容区块 --- */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px;
    max-width: 540px;
    width: 100%;
    animation: heroFadeIn 1.2s ease-out;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-family: 'Noto Serif SC', 'Source Serif 4', 'SimSun', serif;
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5em;
    margin-right: -0.5em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 60px;
    letter-spacing: 0.2em;
}

/* --- 首页：隐藏导航栏 + 去掉 site-main 的 padding --- */
.home .site-header { display: none; }
.home .site-main {
    padding: 0;
}

/* --- 首页透明导航栏 --- */
.home .site-header.header-transparent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
    box-shadow: none;
}

/* --- 滚动后导航变实色（JS 控制 .header-solid） --- */
.home .site-header.header-solid {
    position: fixed;
    background: linear-gradient(135deg, #6B2818 0%, #8B3A2C 50%, #a24434 100%);
    box-shadow: 0 2px 16px rgba(92, 46, 14, 0.25);
}

.home .site-header.header-transparent,
.home .site-header.header-solid {
    transition: background 0.35s ease, box-shadow 0.35s ease;
}

/* --- 内容页通用样式 --- */
.page-content {
    padding: 40px 0;
}

/* ========================================
   首页查询组件 + 弹窗
   ======================================== */

/* --- 首页简化导航链接 --- */
.nav-login-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-login-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

/* --- 首页右上角链接（极简） --- */
.hero-nav-link {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 10;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    text-decoration: none;
    padding: 6px 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    transition: all 0.2s;
}
.hero-nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* --- 玻璃拟态查询卡片 --- */
.query-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 36px 32px 28px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

.query-card-title {
    font-family: 'Noto Serif SC', 'Source Serif 4', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.query-card-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
}

/* --- 查询输入组（胶囊形） --- */
.query-input-group {
    display: flex;
    border-radius: 50px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.query-input-group:focus-within {
    box-shadow: 0 0 30px rgba(139, 58, 44, 0.4);
    border-color: rgba(139, 58, 44, 0.7);
}

.query-input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    color: #fff;
    outline: none;
}

.query-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.query-submit-btn {
    padding: 0 32px !important;
    border: none !important;
    border-radius: 0 50px 50px 0 !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    white-space: nowrap;
    letter-spacing: 2px;
    background: #8B3A2C !important;
    color: #fff !important;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.query-submit-btn:hover:not(:disabled) {
    background: #a24434 !important;
    transform: none !important;
    box-shadow: none !important;
}

.query-submit-btn:active {
    transform: scale(0.98) !important;
}

.query-hint {
    margin-top: 14px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.06em;
}

.query-countdown {
    display: block;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* --- 结果弹窗 --- */
.result-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.result-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.result-modal-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 36px 32px 28px;
    width: 90%;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.result-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.result-modal-close:hover {
    color: #333;
}

/* --- 弹窗内容 --- */
.rm-image {
    margin: 0 auto 20px;
    text-align: center;
    border-radius: 12px;
    overflow: hidden;
}

.rm-image img {
    display: block;
    max-width: 60%;
    max-height: 320px;
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.rm-name {
    font-size: 1.2rem;
    color: #6B2818;
    margin-bottom: 14px;
    font-weight: 700;
}

.rm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin-bottom: 16px;
}

.rm-table td {
    padding: 8px 0;
    border-bottom: 1px solid #f0ece5;
    vertical-align: middle;
}

.rm-table tr:last-child td {
    border-bottom: none;
}

.rm-label {
    color: #999;
    width: 70px;
    font-size: 0.85rem;
}

.rm-table code {
    background: #f5f2ed;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.88rem;
}

.rm-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.rm-status.bound {
    background: #fff3cd;
    color: #856404;
}

.rm-status.unbound {
    background: #d4edda;
    color: #155724;
}

.rm-notice {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 8px;
}

.rm-notice.success {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #b7dfc2;
}

.rm-notice a {
    font-weight: 600;
}

.rm-bind-btn {
    display: inline-block;
    background: #8B3A2C;
    color: #fff !important;
    padding: 6px 20px;
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.rm-bind-btn:hover {
    background: #a24434;
}

.rm-error {
    text-align: center;
    padding: 24px 0;
    color: #c62828;
    font-size: 1rem;
}

/* --- 弹窗打开时锁定滚动 --- */
body.modal-open {
    overflow: hidden;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
    .site-header .container { height: 56px; }

    .menu-toggle { display: block; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #6B2818;
        flex-direction: column;
        padding: 12px;
        gap: 2px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }

    .nav-menu.active { display: flex; }

    .nav-menu a {
        display: block;
        padding: 12px 16px;
        border-radius: 8px;
    }

    .auth-card { padding: 28px 20px; }

    .container { padding: 0 16px; }

    .hero-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 1rem;
        margin-bottom: 28px;
    }

    .hero-buttons .btn {
        min-width: 140px;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .query-card {
        padding: 32px 24px 28px;
        border-radius: 16px;
    }

    .query-card-title {
        font-size: 1.3rem;
    }

    .query-input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .query-submit-btn {
        padding: 12px 18px !important;
        font-size: 0.9rem !important;
        letter-spacing: 1px;
    }

    .result-modal-card {
        padding: 28px 20px 22px;
        max-width: 92%;
    }

    .rm-image {
        margin: 0 auto 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-tagline {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 260px;
    }
}
