/* 益守护 - 全局样式 & 主题系统 */
:root,
[data-theme="default"] {
    --primary: #1e3a5f;
    --primary-light: #2d5a87;
    --primary-dark: #152a45;
    --accent: #e8734a;
    --accent-light: #f0956e;
    --accent-dark: #c85a32;
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --bg-sidebar: #1e3a5f;
    --bg-sidebar-hover: #2d5a87;
    --text: #2d3748;
    --text-light: #718096;
    --text-muted: #a0aec0;
    --border: #e2e8f0;
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --info: #3182ce;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.25s ease;
}

[data-theme="dark"] {
    --primary: #90cdf4;
    --primary-light: #bee3f8;
    --primary-dark: #63b3ed;
    --accent: #f6ad55;
    --accent-light: #fbd38d;
    --accent-dark: #ed8936;
    --bg: #1a202c;
    --bg-card: #2d3748;
    --bg-sidebar: #171923;
    --bg-sidebar-hover: #2d3748;
    --text: #e2e8f0;
    --text-light: #a0aec0;
    --text-muted: #718096;
    --border: #4a5568;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

[data-theme="ocean"] {
    --primary: #0077b6;
    --primary-light: #00b4d8;
    --primary-dark: #023e8a;
    --accent: #48cae4;
    --accent-light: #90e0ef;
    --accent-dark: #0096c7;
    --bg: #f0f8ff;
    --bg-card: #ffffff;
    --bg-sidebar: #023e8a;
    --bg-sidebar-hover: #0077b6;
    --text: #1b263b;
    --text-light: #415a77;
    --text-muted: #778da9;
    --border: #caf0f8;
    --shadow: 0 2px 8px rgba(0,119,182,0.08);
    --shadow-lg: 0 8px 24px rgba(0,119,182,0.12);
}

[data-theme="forest"] {
    --primary: #2d6a4f;
    --primary-light: #40916c;
    --primary-dark: #1b4332;
    --accent: #d4a373;
    --accent-light: #e9c46a;
    --accent-dark: #bc6c25;
    --bg: #f8f9f0;
    --bg-card: #ffffff;
    --bg-sidebar: #1b4332;
    --bg-sidebar-hover: #2d6a4f;
    --text: #2b2d2f;
    --text-light: #555b6e;
    --text-muted: #89919e;
    --border: #d8e2dc;
    --shadow: 0 2px 8px rgba(45,106,79,0.08);
    --shadow-lg: 0 8px 24px rgba(45,106,79,0.12);
}

[data-theme="sunset"] {
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #5b21b6;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dark: #d97706;
    --bg: #faf5ff;
    --bg-card: #ffffff;
    --bg-sidebar: #3b0764;
    --bg-sidebar-hover: #5b21b6;
    --text: #1e1b4b;
    --text-light: #4c1d95;
    --text-muted: #7c3aed;
    --border: #e9d5ff;
    --shadow: 0 2px 8px rgba(124,58,237,0.08);
    --shadow-lg: 0 8px 24px rgba(124,58,237,0.12);
}

/* 基础重置 */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* 容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 768px; margin: 0 auto; padding: 0 16px; }

/* 卡片 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ''; width: 4px; height: 20px; background: var(--accent); border-radius: 2px; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all var(--transition); text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-control {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card); color: var(--text);
    transition: border-color var(--transition);
    outline: none; font-size: 14px;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.1); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.form-control { min-height: 100px; resize: vertical; }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { background: var(--bg); font-weight: 600; color: var(--text-light); font-size: 13px; white-space: nowrap; }
.table tr:hover td { background: rgba(30,58,95,0.02); }

/* 徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-success { background: #c6f6d5; color: #22543d; }
.badge-warning { background: #fefcbf; color: #744210; }
.badge-danger { background: #fed7d7; color: #742a2a; }
.badge-info { background: #bee3f8; color: #2a4365; }
.badge-default { background: #e2e8f0; color: #4a5568; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); text-align: center; transition: transform var(--transition); }
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 24px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* 导航栏 */
.navbar {
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky; top: 0; z-index: 100;
    padding: 0 16px;
}
.navbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.navbar-brand { font-size: 20px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.navbar-brand span { color: var(--accent); }
.navbar-nav { display: flex; gap: 4px; list-style: none; }
.navbar-nav a { padding: 8px 16px; border-radius: var(--radius); color: var(--text-light); font-size: 14px; font-weight: 500; transition: all var(--transition); }
.navbar-nav a:hover, .navbar-nav a.active { color: var(--primary); background: rgba(30,58,95,0.06); }
.navbar-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--text); cursor: pointer; }

/* 页脚 */
.footer { background: var(--primary-dark); color: rgba(255,255,255,0.7); padding: 40px 16px 20px; margin-top: 60px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.footer h4 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.footer a { color: rgba(255,255,255,0.6); display: block; padding: 4px 0; font-size: 14px; }
.footer a:hover { color: var(--accent); }
.footer-bottom { max-width: 1200px; margin: 24px auto 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 13px; }

/* 时间轴 */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 24px; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-card); }
.timeline-item .time { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.timeline-item .content { font-size: 14px; color: var(--text); }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 24px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: var(--radius); font-size: 14px; border: 1px solid var(--border); color: var(--text); }
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 模态框 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); border-radius: var(--radius-lg); max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-light); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

/* 管理后台布局 */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px; background: var(--bg-sidebar); color: #fff;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    display: flex; flex-direction: column;
    transition: transform var(--transition);
}
.admin-sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar-header h2 { font-size: 18px; color: #fff; }
.admin-sidebar-header p { font-size: 12px; opacity: 0.6; margin-top: 4px; }
.admin-sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.admin-sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px; color: rgba(255,255,255,0.7);
    font-size: 14px; transition: all var(--transition);
    border-left: 3px solid transparent;
}
.admin-sidebar-nav a:hover { background: var(--bg-sidebar-hover); color: #fff; }
.admin-sidebar-nav a.active { background: var(--bg-sidebar-hover); color: #fff; border-left-color: var(--accent); }
.admin-sidebar-nav .nav-icon { width: 20px; text-align: center; font-size: 16px; }
.admin-sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.admin-main { flex: 1; margin-left: 240px; }
.admin-topbar {
    background: var(--bg-card); padding: 0 24px;
    height: 60px; display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky; top: 0; z-index: 40;
}
.admin-topbar .page-title { font-size: 18px; font-weight: 600; }
.admin-topbar .topbar-actions { display: flex; align-items: center; gap: 12px; }
.admin-content { padding: 24px; }

/* 主题切换器 */
.theme-switcher { display: flex; gap: 6px; align-items: center; }
.theme-dot { width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all var(--transition); }
.theme-dot:hover { transform: scale(1.2); }
.theme-dot.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg); }
.theme-dot[data-theme="default"] { background: linear-gradient(135deg, #1e3a5f, #e8734a); }
.theme-dot[data-theme="dark"] { background: linear-gradient(135deg, #1a202c, #f6ad55); }
.theme-dot[data-theme="ocean"] { background: linear-gradient(135deg, #0077b6, #48cae4); }
.theme-dot[data-theme="forest"] { background: linear-gradient(135deg, #2d6a4f, #d4a373); }
.theme-dot[data-theme="sunset"] { background: linear-gradient(135deg, #7c3aed, #f59e0b); }

/* Hero区域 */
.hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    color: #fff; padding: 60px 16px; text-align: center;
}
.hero h1 { font-size: 36px; margin-bottom: 12px; }
.hero p { font-size: 16px; opacity: 0.85; max-width: 600px; margin: 0 auto; }

/* 响应式 */
@media (max-width: 768px) {
    .navbar-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg-card); flex-direction: column; padding: 12px; box-shadow: var(--shadow); }
    .navbar-nav.show { display: flex; }
    .navbar-toggle { display: block; }
    .hero h1 { font-size: 26px; }
    .hero { padding: 40px 16px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr; }
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 16px; }
    .table th, .table td { padding: 8px 10px; font-size: 13px; }
    .modal { margin: 8px; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .stat-card .stat-value { font-size: 22px; }
}

/* 动画 */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease; }

/* 筛选栏 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; min-width: 150px; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }

/* 星级评分 */
.star-rating { display: flex; gap: 4px; }
.star-rating .star { font-size: 20px; color: #e2e8f0; cursor: pointer; }
.star-rating .star.active { color: #f6ad55; }

/* 照片网格 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photo-grid img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius); cursor: pointer; }

/* 打印隐藏 */
@media print {
    .admin-sidebar, .admin-topbar, .no-print { display: none !important; }
    .admin-main { margin-left: 0 !important; }
}
