/* ============================================
   永颐无机磨石 - 施工管理工具 样式
   ============================================ */

:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --secondary: #e67e22;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --border-radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    color: var(--dark-text);
    background: var(--light-bg);
    line-height: 1.6;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 1.2rem 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.app-header .subtitle {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 0.2rem;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 0;
    background: white;
    border-bottom: 2px solid #e9ecef;
    padding: 0 2rem;
    overflow-x: auto;
}

.nav-tab {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    position: relative;
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--primary);
    background: rgba(41, 128, 185, 0.05);
}

.nav-tab.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-light);
    border-radius: 3px 3px 0 0;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.card h3 {
    font-size: 1rem;
    color: var(--dark-text);
    margin-bottom: 0.8rem;
}

/* Calculator Form */
.calc-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 0.8rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-light);
    color: white;
}

.btn-primary:hover {
    background: var(--primary);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-1px);
}

/* Results Table */
.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.result-table th,
.result-table td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.result-table th {
    background: var(--light-bg);
    font-weight: 600;
    color: #555;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.result-table tr:hover {
    background: #f0f7ff;
}

.result-table .layer-header td {
    background: #e8f4fd;
    font-weight: 600;
    color: var(--primary);
}

/* Checklist */
.checklist-category {
    margin-bottom: 1rem;
}

.checklist-category h3 {
    background: var(--light-bg);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checklist-category h3 .progress-badge {
    font-size: 0.8rem;
    background: var(--primary-light);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.checklist-item:hover {
    background: #f8f9ff;
}

.checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.8rem;
    accent-color: var(--success);
    cursor: pointer;
}

.checklist-item label {
    cursor: pointer;
    font-size: 0.9rem;
    flex: 1;
}

.checklist-item.checked label {
    text-decoration: line-through;
    color: #999;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #2ecc71);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Schedule Table */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
    padding: 0.7rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.schedule-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
}

.phase-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.phase-prep { background: #e1f5fe; color: #01579b; }
.phase-base { background: #fff3e0; color: #e65100; }
.phase-surface { background: #f3e5f5; color: #4a148c; }
.phase-grind { background: #e8f5e9; color: #1b5e20; }
.phase-seal { background: #fff9c4; color: #f57f17; }
.phase-accept { background: #fce4ec; color: #880e4f; }

/* Parameter Grid */
.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.param-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
}

.param-card h4 {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.param-card .param-item {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #f5f5f5;
}

.param-card .param-item:last-child {
    border-bottom: none;
}

.param-card .param-label {
    color: #666;
}

.param-card .param-value {
    font-weight: 600;
    color: var(--dark-text);
}

/* Summary Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.3rem;
}

/* ============================================
   响应式工具类
   ============================================ */

/* 表格横向滚动容器 */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}
.table-responsive > table {
    margin-bottom: 0;
    min-width: 500px;
}

/* 移动端显示控制 */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-sm-none { display: none !important; }
.d-sm-block { display: block !important; }
@media (min-width: 576px) { .d-sm-none { display: none !important; } .d-sm-block { display: block !important; } }
@media (min-width: 768px) { .d-md-none { display: none !important; } .d-md-block { display: block !important; } }
@media (min-width: 992px) { .d-lg-none { display: none !important; } .d-lg-block { display: block !important; } }

/* 移动端最小触控尺寸 */
.touch-target {
    min-height: 44px;
    min-width: 44px;
}

/* 移动端表单行 - 垂直排列 */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.form-row > * {
    flex: 1 1 auto;
    min-width: 100px;
}

/* 响应式网格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* 文本截断 */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 间距工具 */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ============================================
   响应式布局 - 平板 (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .app-header {
        padding: 0.8rem 1rem;
    }
    .app-header h1 {
        font-size: 1.2rem;
    }
    .app-header .subtitle {
        font-size: 0.75rem;
    }
    .nav-tabs {
        padding: 0 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }
    .nav-tab {
        padding: 0.6rem 0.9rem;
        font-size: 0.78rem;
        flex-shrink: 0;
    }
    .main-content {
        padding: 0.8rem 1rem;
    }
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    .card h2 {
        font-size: 1.05rem;
    }
    .calc-form {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    .stat-card {
        padding: 0.8rem;
    }
    .stat-card .stat-number {
        font-size: 1.4rem;
    }
    .param-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    .form-row > * {
        min-width: 80px;
        flex: 1 1 45%;
    }
    .result-table {
        font-size: 0.8rem;
    }
    .result-table th,
    .result-table td {
        padding: 0.4rem 0.5rem;
    }
    .schedule-table th,
    .schedule-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    .checklist-item {
        padding: 0.4rem 0.6rem;
    }
    .checklist-item label {
        font-size: 0.8rem;
    }
    .checklist-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }
    #photoGallery {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .project-selector {
        max-width: 160px;
        font-size: 0.78rem;
    }
}

/* ============================================
   响应式布局 - 手机 (≤576px)
   ============================================ */
@media (max-width: 576px) {
    .app-header h1 {
        font-size: 1rem;
    }
    .app-header .subtitle span:first-child {
        display: none;
    }
    .nav-tab {
        padding: 0.5rem 0.7rem;
        font-size: 0.7rem;
    }
    .main-content {
        padding: 0.5rem 0.6rem;
    }
    .card {
        padding: 0.8rem;
        border-radius: 6px;
    }
    .card h2 {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }
    .stat-card {
        padding: 0.6rem;
    }
    .stat-card .stat-number {
        font-size: 1.2rem;
    }
    .stat-card .stat-label {
        font-size: 0.65rem;
    }
    .param-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .calc-form {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .form-row {
        flex-direction: column;
        gap: 6px;
    }
    .form-row > * {
        min-width: 100%;
        flex: 1 1 100%;
    }
    .result-table {
        font-size: 0.72rem;
    }
    .result-table th,
    .result-table td {
        padding: 0.3rem 0.4rem;
    }
    .schedule-table th,
    .schedule-table td {
        padding: 0.4rem;
        font-size: 0.75rem;
    }
    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        width: 100%;
        text-align: center;
    }
    .btn + .btn {
        margin-top: 0.3rem;
    }
    .form-group input,
    .form-group select {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }
    .form-group label {
        font-size: 0.78rem;
    }
    .param-card {
        padding: 0.7rem;
    }
    .param-card .param-item {
        font-size: 0.78rem;
    }
    .checklist-category h3 {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    .checklist-item {
        padding: 0.35rem 0.5rem;
    }
    .checklist-item label {
        font-size: 0.78rem;
    }
    .checklist-item input[type="checkbox"] {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }
    #photoGallery {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }
    .progress-bar {
        height: 6px;
    }
    .project-selector {
        max-width: 120px;
        font-size: 0.72rem;
    }
    .phase-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    .toast {
        left: 10px;
        right: 10px;
        bottom: 10px;
        font-size: 0.8rem;
        text-align: center;
    }
}

/* ============================================
   响应式布局 - 极小屏 (≤400px)
   ============================================ */
@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    .nav-tab {
        padding: 0.4rem 0.5rem;
        font-size: 0.65rem;
    }
    .result-table {
        font-size: 0.68rem;
    }
    .result-table th,
    .result-table td {
        padding: 0.25rem 0.3rem;
    }
    #photoGallery {
        grid-template-columns: 1fr !important;
    }
}

/* Print */
@media print {
    .nav-tabs, .app-header, .no-print { display: none !important; }
    .tab-panel { display: block !important; }
    .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
    .table-responsive { overflow: visible; }
}

/* ============================================
   深色模式
   ============================================ */
[data-theme="dark"] {
    --primary: #2980b9;
    --primary-light: #3498db;
    --secondary: #f39c12;
    --success: #2ecc71;
    --danger: #e74c3c;
    --light-bg: #1a1a2e;
    --dark-text: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] body {
    background: #16213e;
    color: #e0e0e0;
}

[data-theme="dark"] .card {
    background: #1a1a2e;
    border-color: #2a2a4a;
}

[data-theme="dark"] .result-table th,
[data-theme="dark"] .schedule-table th {
    background: #16213e;
    color: #aaa;
}

[data-theme="dark"] .result-table td,
[data-theme="dark"] .schedule-table td {
    border-color: #2a2a4a;
    color: #ccc;
}

[data-theme="dark"] .result-table tr:hover {
    background: #1a2744;
}

[data-theme="dark"] .layer-header td {
    background: #0f3460 !important;
    color: #85c1e9;
}

[data-theme="dark"] .param-card {
    background: #1a1a2e;
    border-color: #2a2a4a;
}

[data-theme="dark"] .param-card .param-item {
    border-color: #2a2a4a;
}

[data-theme="dark"] .nav-tabs {
    background: #1a1a2e;
    border-color: #2a2a4a;
}

[data-theme="dark"] .nav-tab {
    color: #888;
}

[data-theme="dark"] .nav-tab:hover {
    color: #3498db;
    background: rgba(52,152,219,0.1);
}

[data-theme="dark"] .nav-tab.active {
    color: #3498db;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #16213e;
    border-color: #2a2a4a;
    color: #e0e0e0;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.2);
}

[data-theme="dark"] .stat-card {
    background: #1a1a2e;
}

[data-theme="dark"] .phase-badge {
    opacity: 0.8;
}

[data-theme="dark"] .checklist-category h3 {
    background: #16213e;
}

[data-theme="dark"] .checklist-item {
    border-color: #2a2a4a;
}

[data-theme="dark"] .checklist-item:hover {
    background: #1a2744;
}

[data-theme="dark"] .progress-bar {
    background: #2a2a4a;
}

[data-theme="dark"] .app-header {
    background: linear-gradient(135deg, #0f3460, #1a5276);
}

[data-theme="dark"] .toast {
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* 主题切换按钮 */
.theme-toggle {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    padding: 4px 12px;
    font-size: 0.8rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.25);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255,255,255,0.1);
}

/* 移动端优化 */
@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stat-card {
        padding: 10px;
    }
    .stat-card .stat-number {
        font-size: 1.3rem;
    }
    .card {
        padding: 12px;
    }
    .card h2 {
        font-size: 1rem;
    }
    .result-table {
        font-size: 0.75rem;
    }
    .result-table th,
    .result-table td {
        padding: 4px 6px;
    }
    .param-grid {
        grid-template-columns: 1fr;
    }
    .calc-form {
        grid-template-columns: 1fr;
    }
    .nav-tab {
        padding: 0.5rem 0.7rem;
        font-size: 0.7rem;
    }
    .app-header h1 {
        font-size: 1.1rem;
    }
    #photoGallery {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
}

/* ========== 全局导航侧边栏 ========== */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}
.sidebar {
    position: fixed;
    top: 0; left: -300px;
    width: 280px;
    height: 100vh;
    background: var(--card-bg, #fff);
    z-index: 1000;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    transition: left 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar.open {
    left: 0;
}
.sidebar-header {
    padding: 16px;
    background: linear-gradient(135deg, #1a5276 0%, #2980b9 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}
.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.sidebar-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #eee);
}
.sidebar-section-title {
    padding: 4px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary, #888);
    letter-spacing: 0.5px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-color, #333);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    background: var(--hover-bg, #f0f7ff);
}
.sidebar-link.active {
    background: var(--active-bg, #e8f4fd);
    border-left-color: #2980b9;
    color: #2980b9;
    font-weight: 600;
}
.sidebar-link .link-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar-footer {
    margin-top: auto;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #eee);
    font-size: 0.75rem;
    color: var(--text-secondary, #999);
    text-align: center;
}
/* 汉堡按钮 */
.hamburger-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    line-height: 1;
    display: none;
    transition: background 0.15s;
}
.hamburger-btn:hover {
    background: rgba(255,255,255,0.25);
}
@media (min-width: 769px) {
    .hamburger-btn {
        display: inline-flex;
        align-items: center;
    }
}
@media (max-width: 768px) {
    .sidebar { width: 260px; left: -260px; }
    .hamburger-btn { display: inline-flex; align-items: center; }
}
[data-theme="dark"] .sidebar { background: #1a1a2e; border-right: 1px solid #2a2a4a; }
[data-theme="dark"] .sidebar-link { color: #ccc; }
[data-theme="dark"] .sidebar-link:hover { background: #2a2a4a; }
[data-theme="dark"] .sidebar-link.active { background: #1a2a4a; border-left-color: #4a9eff; color: #4a9eff; }
[data-theme="dark"] .sidebar-section { border-bottom-color: #2a2a4a; }
[data-theme="dark"] .sidebar-footer { border-top-color: #2a2a4a; }

/* ========== 全局搜索框 ========== */
.global-search-wrap {
    position: relative;
    display: none;
}
@media (min-width: 769px) {
    .global-search-wrap { display: inline-flex; align-items: center; }
}
.global-search-input {
    padding: 4px 10px 4px 28px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 16px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 0.8rem;
    width: 140px;
    transition: width 0.3s, background 0.3s;
    outline: none;
}
.global-search-input:focus {
    width: 200px;
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}
.global-search-input::placeholder { color: rgba(255,255,255,0.6); }
.search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0.7;
}
.search-results-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1001;
    display: none;
    margin-top: 6px;
}
[data-theme="dark"] .search-results-dropdown { background: #1a1a2e; border-color: #2a2a4a; }
[data-theme="dark"] .search-results-dropdown a { color: #ccc !important; }
[data-theme="dark"] .search-results-dropdown a:hover { background: #2a2a4a !important; }

/* ========== 通知徽章 ========== */
.notif-bell-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #e74c3c;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    display: none;
}

/* ========== 导出按钮 ========== */
.btn-export {
    background: #27ae60;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s;
}
.btn-export:hover { background: #219a52; }

/* ========== 移动端搜索 ========== */
@media (max-width: 768px) {
    .search-results-dropdown { width: 280px; right: -60px; }
    .global-search-input { width: 100px; font-size: 0.7rem; }
    .global-search-input:focus { width: 140px; }
}
@media (max-width: 576px) {
    .search-results-dropdown { width: 240px; right: -80px; }
}
