/* =============================================
   知满堂健康管理系统 - 全局样式
   风格：大气典雅，融合传统中医文化元素
   编码：UTF-8
   ============================================= */

/* 字体定义 */
@font-face {
    font-family: 'Noto Serif SC';
    font-style: normal;
    font-weight: 400;
    src: local('Noto Serif SC'), local('STSong'), local('SimSun');
}
@font-face {
    font-family: 'Noto Serif SC';
    font-style: normal;
    font-weight: 600;
    src: local('Noto Serif SC Bold'), local('STSong'), local('SimSun');
}

:root {
    --primary: #8B1A1A;        /* 朱砂红 */
    --primary-light: #A0522D;  /* 赭石 */
    --primary-dark: #6B0F0F;   /* 深红 */
    --gold: #C8A96E;           /* 金色 */
    --gold-light: #E8D5A3;     /* 浅金 */
    --dark: #2C1810;           /* 深棕 */
    --text: #3D2B1F;           /* 主文字 */
    --text-light: #7A6055;     /* 次要文字 */
    --bg: #FAF7F2;             /* 背景米白 */
    --bg-card: #FEFCF8;        /* 卡片背景 */
    --border: #E8DDD0;         /* 边框 */
    --shadow: rgba(139,26,26,0.12);
    --radius: 8px;
    --radius-lg: 16px;
    --font: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #FAF7F2;
    color: #3D2B1F;
    line-height: 1.7;
    font-size: 15px;
}

/* ---- 侧边栏导航图标对齐 ---- */
.sidebar-nav a {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    color: #3D2B1F;
    text-decoration: none;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}
.sidebar-nav a i {
    min-width: 1.4rem !important;
    text-align: center;
    font-style: normal;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: linear-gradient(135deg, #8B1A1A, #A0522D);
    color: #fff;
}

/* 后台侧边栏使用浅色文字 */
.admin-sidebar .sidebar-nav a {
    color: #E8D5A3;
}

/* ---- 排版 ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    color: #2C1810;
    line-height: 1.4;
}

a {
    color: #8B1A1A;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #C8A96E;
}

/* ---- 导航栏 ---- */
.navbar {
    background: linear-gradient(135deg, #2C1810 0%, #4A1C0C 100%);
    border-bottom: 3px solid #C8A96E;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.navbar-brand .brand-icon {
    width: 44px;
    height: 44px;
}

.navbar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.navbar-brand .brand-name {
    font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    font-size: 1.3rem;
    color: #C8A96E;
    letter-spacing: 2px;
    line-height: 1.2;
}

.navbar-brand .brand-sub {
    font-size: 0.7rem;
    color: rgba(200,169,110,0.53);
    letter-spacing: 3px;
}

.nav-link {
    color: rgba(232,213,163,0.87) !important;
    font-size: 0.95rem;
    padding: 1rem 1.1rem !important;
    transition: all 0.3s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #C8A96E;
    transition: all 0.3s;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

.nav-link:hover,
.nav-link.active {
    color: #C8A96E !important;
}

/* ---- 下拉菜单图标对齐 ---- */
.dropdown-menu {
    border: 1px solid #E8DDD0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(139,26,26,0.12);
}
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
}
.dropdown-item i {
    min-width: 1.4rem;
    text-align: center;
    font-style: normal;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---- 页面头部横幅 ---- */
.page-hero {
    background: linear-gradient(135deg, #2C1810 0%, #6B0F0F 50%, #4A1C0C 100%);
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/pattern.svg');
    opacity: 0.06;
}

.page-hero h1 {
    font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    color: #C8A96E;
    font-size: 2.2rem;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
    position: relative;
}

.page-hero p {
    color: rgba(232,213,163,0.67);
    font-size: 1rem;
    letter-spacing: 2px;
    position: relative;
}

/* ---- 卡片 ---- */
.tcm-card {
    background: #FEFCF8;
    border: 1px solid #E8DDD0;
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: 0 2px 20px rgba(139,26,26,0.12);
    transition: box-shadow 0.3s, transform 0.3s;
}

.tcm-card:hover {
    box-shadow: 0 8px 40px rgba(139,26,26,0.18);
    transform: translateY(-2px);
}

.card-header-tcm {
    border-bottom: 2px solid #E8D5A3;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header-tcm h3 {
    font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    color: #8B1A1A;
    font-size: 1.15rem;
    letter-spacing: 1px;
}

.card-header-tcm .header-icon {
    width: 28px;
    height: 28px;
    background: #8B1A1A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
}

/* ---- 按钮 ---- */
.btn-tcm {
    background: linear-gradient(135deg, #8B1A1A 0%, #A0522D 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    letter-spacing: 0.5px;
}

.btn-tcm:hover {
    background: linear-gradient(135deg, #6B0F0F 0%, #8B1A1A 100%);
    box-shadow: 0 4px 15px rgba(139,26,26,0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-tcm-gold {
    background: linear-gradient(135deg, #C8A96E 0%, #A88940 100%);
    color: #2C1810;
}

.btn-tcm-gold:hover {
    background: linear-gradient(135deg, #A88940 0%, #C8A96E 100%);
    color: #2C1810;
    box-shadow: 0 4px 15px rgba(200,169,110,0.4);
}

.btn-tcm-outline {
    background: transparent;
    color: #8B1A1A;
    border: 2px solid #8B1A1A;
}

.btn-tcm-outline:hover {
    background: #8B1A1A;
    color: white;
}

/* ---- 表单 ---- */
.form-tcm .form-label {
    font-weight: 500;
    color: #3D2B1F;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.form-tcm .form-control,
.form-tcm .form-select,
.form-tcm textarea {
    border: 1px solid #E8DDD0;
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
    color: #3D2B1F;
}

.form-tcm .form-control:focus,
.form-tcm .form-select:focus,
.form-tcm textarea:focus {
    border-color: #8B1A1A;
    box-shadow: 0 0 0 3px rgba(139,26,26,0.12);
    outline: none;
}

/* ---- 四诊模块样式 ---- */
.sijian-section {
    background: linear-gradient(135deg, #FFF8F0 0%, #FEFCF8 100%);
    border: 1px solid #E8D5A3;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.sijian-section::before {
    content: attr(data-label);
    position: absolute;
    top: -12px;
    left: 20px;
    background: linear-gradient(135deg, #8B1A1A 0%, #A0522D 100%);
    color: white;
    padding: 2px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    letter-spacing: 2px;
    font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
}

/* ---- 时间线（复诊记录）---- */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #C8A96E, #8B1A1A);
    opacity: 0.5;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #8B1A1A;
    border: 2px solid #C8A96E;
    box-shadow: 0 0 8px rgba(139,26,26,0.4);
}

.timeline-time {
    font-size: 0.8rem;
    color: #7A6055;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-content {
    background: #FEFCF8;
    border: 1px solid #E8DDD0;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    font-size: 0.92rem;
}

/* ---- 会员徽章 ---- */
.member-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.member-badge.normal {
    background: #f0f0f0;
    color: #999;
}

.member-badge.member {
    background: linear-gradient(135deg, #8B1A1A 0%, #A0522D 100%);
    color: white;
}

.member-badge.vip {
    background: linear-gradient(135deg, #C8A96E 0%, #A88940 100%);
    color: #2C1810;
}

/* ---- 文章卡片 ---- */
.article-card {
    background: #FEFCF8;
    border: 1px solid #E8DDD0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
    height: 100%;
}

.article-card:hover {
    box-shadow: 0 8px 30px rgba(139,26,26,0.12);
    transform: translateY(-3px);
}

.article-card .card-img-top {
    height: 180px;
    object-fit: cover;
}

.article-card .article-meta {
    font-size: 0.8rem;
    color: #7A6055;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.article-card .article-category {
    background: #E8D5A3;
    color: #8B1A1A;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
}

/* ---- 留言区 ---- */
.comment-item {
    border-bottom: 1px solid #E8DDD0;
    padding: 1.2rem 0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B1A1A 0%, #A0522D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    flex-shrink: 0;
}

.admin-reply {
    background: linear-gradient(135deg, #FFF8EE 0%, #FEF9F0 100%);
    border-left: 3px solid #C8A96E;
    padding: 0.8rem 1rem;
    margin-top: 0.8rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
}

.admin-reply .reply-label {
    color: #8B1A1A;
    font-weight: 600;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.3rem;
}

/* ---- 页脚 ---- */
.site-footer {
    background: linear-gradient(135deg, #2C1810 0%, #1A0A05 100%);
    border-top: 3px solid #C8A96E;
    padding: 3rem 0 1.5rem;
    color: rgba(200,169,110,0.67);
    font-size: 0.88rem;
}

.site-footer h5 {
    color: #C8A96E;
    font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.site-footer a {
    color: rgba(200,169,110,0.67);
    text-decoration: none;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: #C8A96E;
}

.footer-divider {
    border-color: rgba(200,169,110,0.2);
    margin: 1.5rem 0;
}

/* ---- 分隔装饰 ---- */
.section-divider {
    text-align: center;
    position: relative;
    margin: 2rem 0;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #C8A96E, transparent);
}

.section-divider span {
    background: #FAF7F2;
    padding: 0 1rem;
    color: #C8A96E;
    font-size: 1.2rem;
    position: relative;
}

/* ---- 状态标签 ---- */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
}

.tag-success { background: #E8F5E9; color: #2E7D32; }
.tag-warning { background: #FFF8E1; color: #F57F17; }
.tag-danger  { background: #FFEBEE; color: #C62828; }
.tag-info    { background: #E3F2FD; color: #1565C0; }
.tag-tcm     { background: #FFF3E0; color: #8B1A1A; border: 1px solid #E8D5A3; }

/* ---- 提示框 ---- */
.alert-tcm {
    border-radius: 8px;
    border: 1px solid;
    padding: 0.85rem 1.2rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-tcm.success { background: #F1F8E9; border-color: #A5D6A7; color: #33691E; }
.alert-tcm.error   { background: #FFEBEE; border-color: #EF9A9A; color: #B71C1C; }
.alert-tcm.warning { background: #FFF8E1; border-color: #FFE082; color: #E65100; }
.alert-tcm.info    { background: #E8F4FD; border-color: #90CAF9; color: #0D47A1; }

/* ---- 加载动画 ---- */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #E8D5A3;
    border-top-color: #8B1A1A;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .page-hero h1 { font-size: 1.6rem; }
    .navbar-brand .brand-name { font-size: 1.1rem; }
    .tcm-card { padding: 1.2rem; }
}

/* ---- 打印优化 ---- */
@media print {
    .navbar, .site-footer, .btn { display: none !important; }
    .tcm-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ---- 滚动条美化 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #FAF7F2; }
::-webkit-scrollbar-thumb { background: #C8A96E; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8B1A1A; }

/* ---- 选中文字颜色 ---- */
::selection { background: #E8D5A3; color: #2C1810; }
