/* --- 全局与基础样式 --- */
:root {
    --primary-color: #1a73e8;
    --primary-dark: #0d47a1;
    --primary-light: #e8f0fe;
    --background: linear-gradient(135deg, #1a2980, #26d0ce);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-color: #202124;
    --text-light: #5f6368;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; }
body { background: var(--background); min-height: 100vh; padding: 20px; color: var(--text-color); background-attachment: fixed; line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; }

/* --- 顶部栏 --- */
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; background: rgba(255, 255, 255, 0.92); border-radius: 16px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); margin-bottom: 40px; backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.3); }
.time-info { display: flex; align-items: center; gap: 25px; }
.time { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
.date { font-size: 1rem; color: var(--text-light); margin-top: 5px; font-weight: 500; }
.search-container { flex-grow: 1; max-width: 650px; margin: 0 30px; }
.search-box { display: flex; height: 55px; border-radius: 30px; overflow: hidden; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); transition: all 0.3s ease; }
.search-box:hover { box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4); }
.search-box input { flex-grow: 1; border: none; padding: 0 25px; font-size: 1.1rem; outline: none; background: #fff; }
.search-box button { width: 70px; background: var(--primary-color); border: none; color: white; cursor: pointer; transition: background 0.3s; font-size: 1.2rem; }
.search-box button:hover { background: #0d62da; }

/* --- 主标题 --- */
.main-title { text-align: center; margin: 30px 0 40px; color: white; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.main-title h1 { font-size: 3rem; margin-bottom: 15px; font-weight: 700; }
.main-title p { font-size: 1.2rem; opacity: 0.9; }

/* --- 选项卡 Tabs --- */
.tabs { display: flex; gap: 10px; margin-bottom: 30px; border-bottom: 2px solid rgba(255,255,255,0.3); padding-bottom: 15px; flex-wrap: wrap; }
.tab-button { padding: 12px 25px; font-size: 1.1rem; font-weight: 600; color: rgba(255, 255, 255, 0.7); background: transparent; border: none; cursor: pointer; transition: all 0.3s ease; border-radius: 8px 8px 0 0; display: flex; align-items: center; gap: 10px; }
.tab-button:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.tab-button.active { background: var(--card-bg); color: var(--primary-color); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- 内容通用样式 --- */
.card { background-color: var(--card-bg); border-radius: 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15); overflow: hidden; }
.btn { padding: 10px 18px; background-color: var(--primary-color); color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 1em; transition: background-color 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { background-color: #2980b9; }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.content-header h1 { color: var(--text-color); margin: 0; font-weight: 600; font-size: 1.8rem; }

/* --- Tab 1: 导航链接 --- */
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.nav-category { background: var(--card-bg); border-radius: 16px; padding: 25px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15); }
.category-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid #e0e0e0; color: var(--primary-color); }
.category-title i { font-size: 1.6rem; background: linear-gradient(45deg, var(--primary-color), var(--primary-dark)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.category-title h2 { font-size: 1.5rem; font-weight: 700; }
.nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.nav-link { display: flex; align-items: center; padding: 12px 15px; background: #f8f9fa; border-radius: 10px; color: #202124; text-decoration: none; transition: all 0.3s ease; font-size: 1rem; font-weight: 500; border: 1px solid #e0e0e0; }
.nav-link:hover { background: var(--primary-light); transform: translateX(5px); box-shadow: 0 5px 15px rgba(26, 115, 232, 0.2); border-color: var(--primary-color); }
.nav-link i { margin-right: 12px; font-size: 1.3rem; width: 24px; text-align: center; }

/* --- Tab 2: 服务监控 --- */
.summary-card { background: var(--card-bg); border-radius: 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); padding: 30px; text-align: center; }
.summary-card.uptime { border-top: 4px solid #00bcd4; }
.card-icon { width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 30px; }
.uptime .card-icon { background: rgba(0, 188, 212, 0.15); color: #00bcd4; }
.card-title { font-size: 18px; color: #666; margin-bottom: 10px; font-weight: 500; }
.card-value { font-size: 40px; font-weight: 700; margin-bottom: 5px; }
.uptime .card-value { color: #00bcd4; }
.services-grid { background: var(--card-bg); border-radius: 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); overflow: hidden; }
.service-card { padding: 25px 30px; border-bottom: 1px solid #eee; }
.service-card:last-child { border-bottom: none; }
.service-card-header { cursor: pointer; }
.service-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.service-name { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.service-name .fa-chevron-down { transition: transform 0.3s ease; font-size: 14px; color: #aaa; }
.service-card.expanded .service-name .fa-chevron-down { transform: rotate(180deg); }
.service-status { display: flex; align-items: center; font-size: 16px; font-weight: 500; padding: 8px 20px; border-radius: 30px; }
.status-up { background: rgba(76, 175, 80, 0.15); color: var(--success-color); }
.status-down { background: rgba(244, 67, 54, 0.15); color: var(--danger-color); }
.status-warning { background: rgba(255, 152, 0, 0.15); color: var(--warning-color); }
.service-details { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out; }
.service-card.expanded .service-details { max-height: 500px; }
.service-details-content { padding-top: 20px; border-top: 1px solid #f0f0f0; margin-top: 20px; }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 25px; margin-top: 30px; }
.chart-container { background: var(--card-bg); border-radius: 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); padding: 25px; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.chart-title { font-size: 18px; font-weight: 600; }
.chart-wrapper { height: 300px; position: relative; }
.section-title { font-size: 24px; font-weight: 600; margin-bottom: 25px; margin-top: 10px; display: flex; align-items: center; gap: 12px; color: var(--primary-dark); padding-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.nas-section { margin-bottom: 40px; }
.nas-chart-wrapper { height: 250px; position: relative; }
.detail-chart-container { margin-top: 25px; height: 250px; }

/* --- Tab 3: 我的通知 --- */
#notifications-list { min-height: 200px; padding: 10px; }
.notification-item { padding: 16px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: flex-start; }
.notification-item:last-child { border-bottom: none; }
.notification-content { flex-grow: 1; margin-right: 15px; word-break: break-word; }
.notification-timestamp { font-size: 0.85em; color: var(--text-light); white-space: nowrap; margin-top: 2px; }
#notifications-status-message { text-align: center; margin-top: 15px; }
.status-msg { font-size: 0.9em; padding: 8px 12px; border-radius: 4px; display: inline-flex; align-items: center; gap: 6px; }
.status-msg.success { color: var(--success-color); background-color: rgba(46, 204, 113, 0.1); }
.status-msg.error { color: var(--danger-color); background-color: rgba(231, 76, 60, 0.1); }

/* --- Tab 4: 天气仪表盘 --- */
#latest-weather-cards { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin-bottom: 40px; }
.weather-card { background: white; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); padding: 20px; flex-grow: 1; min-width: 280px; text-align: center; }
.weather-card h2 { margin-top: 0; color: var(--primary-color); font-size: 1.8em; }
.weather-card p { margin: 8px 0; font-size: 1.1em; }
.weather-card .weather-text { font-size: 1.4em; font-weight: bold; color: #2c3e50; }
.weather-card .timestamp { font-size: 0.8em; color: var(--text-light); }
#weather-charts-container { display: flex; flex-direction: column; gap: 40px; align-items: center; }
.weather-chart-container { width: 100%; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }

/* --- 通用状态 (加载/空/错误) --- */
.loading-state, .empty-state, .error-state { text-align: center; padding: 40px 20px; color: var(--text-light); }
.loading-spinner { width: 40px; height: 40px; border: 4px solid rgba(0, 0, 0, 0.1); border-left-color: var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 15px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { color: var(--danger-color); }

/* --- 页脚 --- */
footer { text-align: center; margin-top: 60px; padding: 25px; color: rgba(255, 255, 255, 0.85); font-size: 1rem; border-top: 1px solid rgba(255,255,255,0.2); }

/* --- NAS 实时状态监控 (顶部模块) --- */
/* 【已修正】外层 grid 容器 */
#nas-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
/* 【已修正】单个 NAS 卡片的容器 */
.nas-card-container {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    padding: 15px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.nas-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
}
.nas-metric-card { background: rgba(240, 242, 245, 0.8); padding: 10px; border-radius: 10px; display: flex; align-items: center; gap: 12px; }
.nas-metric-icon { font-size: 1.6em; color: var(--primary-color); }
.nas-metric-details { text-align: left; flex-grow: 1; }
.nas-metric-label { font-size: 0.8em; color: var(--text-light); margin-bottom: 5px; }
.nas-metric-value { font-size: 1.3em; font-weight: 600; color: var(--text-color); }
.nas-metric-value.small-font { font-size: 1em; }
.nas-metric-subvalue { font-size: 0.8em; color: #666; margin-top: 4px; }
.nas-status-footer { text-align: right; margin-top: 10px; font-size: 0.75em; color: #999; }
.nas-error { color: var(--danger-color); }

/* --- 设置图标和弹窗 --- */
.settings-icon { position: fixed; top: 20px; right: 20px; width: 50px; height: 50px; background-color: rgba(255, 255, 255, 0.9); color: var(--primary-color); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 24px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: transform 0.3s ease; z-index: 1000; }
.settings-icon:hover { transform: rotate(90deg); }
.settings-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; z-index: 999; }
.settings-modal { background-color: #fff; padding: 25px; border-radius: 12px; width: 90%; max-width: 600px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.settings-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; }
.settings-modal-header h2 { margin: 0; color: var(--primary-dark); }
.close-button { background: none; border: none; font-size: 28px; cursor: pointer; color: #888; }
.add-nas-form { display: flex; gap: 10px; margin-bottom: 25px; }
.add-nas-form input { flex-grow: 1; padding: 10px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 1rem; }
.add-nas-form button { padding: 10px 15px; background-color: var(--primary-color); color: white; border: none; border-radius: 6px; cursor: pointer; }
.nas-url-list { max-height: 200px; overflow-y: auto; }
.nas-url-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; background-color: #f8f9fa; border-radius: 6px; margin-bottom: 10px; }
.nas-url-item span { word-break: break-all; margin-right: 15px; }
.nas-url-item button { background-color: var(--danger-color); color: white; border: none; border-radius: 4px; cursor: pointer; padding: 5px 10px; }

/* --- 移动端响应式设计 --- */
@media (max-width: 768px) {
    body { padding: 10px; }
    .top-bar { flex-direction: column; gap: 15px; padding: 15px; }
    .time-info { width: 100%; justify-content: space-between; gap: 10px; }
    .time { font-size: 1.2rem; }
    .date { font-size: 0.8rem; }
    .search-container { width: 100%; margin: 0; }
    .search-box { height: 45px; }
    .search-box input { font-size: 1rem; }
    .main-title h1 { font-size: 2rem; }
    .main-title p { font-size: 1rem; }
    .tabs { gap: 5px; margin-bottom: 20px; padding-bottom: 10px; }
    .tab-button { padding: 10px 15px; font-size: 0.9rem; gap: 8px; }
    .content-header h1 { font-size: 1.5rem; }
    .section-title { font-size: 1.5rem; }
    .nav-grid, .nav-links, .charts-grid, .status-summary { grid-template-columns: 1fr; gap: 15px; }
    .nav-category { padding: 15px; }
    .category-title h2 { font-size: 1.2rem; }
    .nav-link { padding: 10px; font-size: 0.9rem; }
    .summary-card { padding: 20px; }
    .card-value { font-size: 2rem; }
    .service-card { padding: 15px; }
    .service-name { font-size: 1rem; }
    .service-status { font-size: 0.9rem; padding: 5px 12px; }
    .weather-card { padding: 15px; min-width: auto; }
    .weather-card h2 { font-size: 1.5rem; }
    .weather-card p { font-size: 1rem; }
    .weather-chart-container { padding: 10px; }
    /* 【已修正】移动端 NAS 布局 */
    #nas-grid-container { grid-template-columns: 1fr; }
    .nas-card-grid { grid-template-columns: 1fr 1fr; }
    .nas-metric-card { flex-direction: column; align-items: center; text-align: center; padding: 10px; }
    .nas-metric-icon { margin-bottom: 8px; }
    .nas-metric-value { font-size: 1.2em; }
    .settings-icon { top: 10px; right: 10px; width: 40px; height: 40px; font
