/* ============================================
   骨科医院会议管理系统 — 全局样式
   ============================================ */

:root {
    --primary:   #1a6b3c;
    --primary-l: #22844a;
    --accent:    #e8a838;
    --bg:        #f5f7fa;
    --card:      #ffffff;
    --text:      #2c3e50;
    --text-sub:  #6b7b8d;
    --border:    #e1e5eb;
    --radius:    8px;
    --shadow:    0 2px 12px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    line-height: 1.6;
}

/* --- Navbar --- */
.navbar {
    background: var(--primary);
    color: #fff;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.navbar .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.navbar .logo span { color: var(--accent); }
.navbar nav { margin-left: auto; display: flex; gap: 1.5rem; }
.navbar nav a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: .95rem;
    transition: color .2s;
}
.navbar nav a:hover, .navbar nav a.active { color: #fff; }

/* --- Container --- */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

/* --- Cards --- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { margin: 0; font-size: 1.15rem; }

/* --- Meeting Card --- */
.meeting-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}
.meeting-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,.1);
}
.meeting-card .cover {
    height: 200px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-l) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    padding: 1rem;
    background-size: cover;
    background-position: center;
    position: relative;
}
.meeting-card .cover .badge-top {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent);
    color: #fff;
    font-size: .75rem;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.meeting-card .info { padding: 1.25rem; }
.meeting-card .info h3 {
    margin: 0 0 .5rem;
    font-size: 1.1rem;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.meeting-card .meta {
    font-size: .85rem;
    color: var(--text-sub);
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.meeting-card .meta i { width: 18px; margin-right: .3rem; }
.meeting-card .status-badge {
    display: inline-block;
    font-size: .75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.badge-published { background: #e8f5e9; color: #2e7d32; }
.badge-draft     { background: #fff3e0; color: #ef6c00; }
.badge-archived  { background: #e3f2fd; color: #1565c0; }

/* --- Grid --- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.2rem;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-l); }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #d49730; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-danger    { background: #e53935; color: #fff; }
.btn-danger:hover { background: #c62828; }
.btn-sm { padding: .35rem .8rem; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }

/* --- Forms --- */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: .35rem;
    color: var(--text);
}
.form-group .required::after { content: ' *'; color: #e53935; }
.form-control {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    transition: border-color .2s;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,107,60,.12);
}
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { appearance: auto; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td {
    padding: .65rem .75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
table th {
    background: var(--bg);
    font-weight: 600;
    white-space: nowrap;
}
table tr:hover td { background: #fafbfc; }

/* --- Tags / Badges --- */
.badge {
    display: inline-block;
    font-size: .75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* --- Section --- */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 1rem;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: .2em;
    bottom: .2em;
    width: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* --- Agenda Timeline --- */
.agenda-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.agenda-item:last-child { border-bottom: none; }
.agenda-time {
    min-width: 100px;
    font-weight: 600;
    color: var(--primary);
    font-size: .95rem;
    white-space: nowrap;
}
.agenda-content { flex: 1; }
.agenda-content h4 { margin: 0 0 .25rem; font-size: 1rem; }
.agenda-content p { margin: 0; font-size: .85rem; color: var(--text-sub); }

/* --- Photo Gallery --- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .75rem;
}
.photo-grid-collapsed {
    max-height: 600px;
    overflow: hidden;
    position: relative;
}
.photo-grid-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, var(--card));
    pointer-events: none;
}
.photo-item {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
}
.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.photo-item:hover img { transform: scale(1.05); }

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: .35rem;
    margin: 2rem 0 1rem;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 .5rem;
    border-radius: 6px;
    font-size: .85rem;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text);
    transition: all .2s;
}
.pagination a:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- Alert / Toast --- */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,.15);
    padding: 1rem 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: .75rem;
    transform: translateX(120%);
    transition: transform .3s ease;
    max-width: 380px;
}
.toast.show { transform: translateX(0); }
.toast-success { border-left: 4px solid #2e7d32; }
.toast-error   { border-left: 4px solid #e53935; }

/* --- Admin Sidebar --- */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: #1a2332;
    color: #fff;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.sidebar .brand {
    padding: 1.25rem 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.sidebar .brand span { color: var(--card); }
.sidebar nav { flex: 1; padding: .75rem 0; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem 1.25rem;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .9rem;
    transition: all .2s;
}
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar nav a.active { color: #fff; background: var(--primary); }
.sidebar nav a i { width: 20px; text-align: center; }
.admin-main { flex: 1; display: flex; flex-direction: column; }
.admin-header {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    justify-content: space-between;
}
.admin-content { flex: 1; padding: 1.5rem; overflow-y: auto; }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-sub);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; }
.empty-state p { font-size: 1rem; }

/* --- Tab 导航滚动条隐藏 --- */
.tab-nav-scroll::-webkit-scrollbar {
    height: 0;
    display: none;
}
.tab-nav-scroll {
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
    background: var(--card);
}

/* --- Tab 右侧滑动箭头 --- */
.tab-scroll-arrow {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 2px;
    width: 40px;
    background: linear-gradient(to right, transparent, var(--card) 50%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    cursor: pointer;
    z-index: 1;
    color: var(--primary);
    font-size: 1.2rem;
    transition: opacity .2s;
}
.tab-scroll-arrow:hover {
    opacity: .8;
}

/* --- Tab 内容区域 --- */
.tab-content {
    min-height: 200px;
}

/* --- Tab 导航容器 --- */
.tab-nav-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
    background: var(--card);
}

/* --- 导航链接图标和文字 --- */
.nav-link-icon { display: none; }
.nav-link-text { display: inline; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .container { padding: 1rem; }
    .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
    .sidebar { width: 60px; }
    .sidebar .brand span, .sidebar nav a span { display: none; }
    .sidebar .brand, .sidebar nav a { justify-content: center; padding: .75rem; }
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: .5rem;
    }
    .photo-grid-collapsed {
        max-height: 400px;
    }
    
    /* 手机端导航栏优化 */
    .navbar nav { gap: .75rem; }
    .navbar nav a { font-size: 0; /* 隐藏文字 */ }
    .navbar nav a .nav-link-icon { display: inline; font-size: 1.2rem; }
    .navbar nav a .nav-link-text { display: none; }
    
    /* Logo 适配 */
    .navbar .logo { font-size: 1rem; }
    .navbar .logo .logo-text-full { display: none; }
    .navbar .logo .logo-text-short { display: inline; }
}

/* ============================================
   自定义弹窗提示 (Toast)
   ============================================ */
.custom-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.custom-toast-success {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.custom-toast-error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border: 1px solid #ef9a9a;
    color: #c62828;
}

.custom-toast-warning {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 1px solid #ffcc80;
    color: #e65100;
}

.custom-toast-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1px solid #90caf9;
    color: #1565c0;
}

.custom-toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.custom-toast-content {
    flex: 1;
}

.custom-toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.custom-toast-message {
    font-weight: 400;
    opacity: 0.9;
    font-size: 14px;
}

.custom-toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    padding: 4px;
    line-height: 1;
    color: inherit;
    transition: opacity 0.2s;
}

.custom-toast-close:hover {
    opacity: 1;
}
