/* ============================================================
   数药智库 公共样式
   ============================================================ */

/* ---------- 全局重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #1a1a1a;
    line-height: 1.6;
}
a { color: #3b82f6; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部导航 ---------- */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.navbar .brand {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}
.navbar .brand a { color: inherit; }
.navbar .brand a:hover { text-decoration: none; }
.navbar .nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}
.navbar .nav-links a {
    padding: 8px 16px;
    border-radius: 6px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
}
.navbar .nav-links a:hover {
    background: #f1f5f9;
    color: #1e293b;
    text-decoration: none;
}
.navbar .nav-links a.active {
    background: #eff6ff;
    color: #2563eb;
}
.navbar .user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* ---------- 通用按钮 ---------- */
.btn {
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    font-weight: 500;
    transition: all 0.15s;
}
.btn-primary {
    background: #3b82f6;
    color: #fff;
}
.btn-primary:hover { background: #2563eb; }
.btn-outline {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}
.btn-outline:hover { background: #f9fafb; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }

/* ---------- 容器 ---------- */
.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 20px;
}
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ---------- 登录/注册弹窗 ---------- */
.auth-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100;
}
.auth-modal.active { display: flex; align-items: center; justify-content: center; }
.auth-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    width: 380px;
    max-width: 90%;
}
.auth-box h2 {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}
.auth-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    border-bottom: 2px solid transparent;
}
.auth-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 500;
}
.auth-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
}
.auth-box input:focus { border-color: #3b82f6; }
.auth-submit {
    width: 100%;
    padding: 10px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 8px;
}
.auth-submit:hover { background: #2563eb; }
.auth-submit:disabled { background: #94a3b8; cursor: not-allowed; }
.auth-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
    min-height: 18px;
}

/* ---------- 表格 ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
}
.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
}
.data-table tbody tr:hover { background: #f9fafb; cursor: pointer; }

/* ---------- 加载动画 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ---------- 空状态 ---------- */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    background: #fff;
    border-radius: 12px;
}


/* ---------- 导航菜单项 ---------- */
.nav-item {
    padding: 8px 16px;
    border-radius: 6px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.nav-item:hover {
    background: #f1f5f9;
    color: #1e293b;
    text-decoration: none;
}
.nav-item.active {
    background: #eff6ff;
    color: #2563eb;
}