/* ========================================
   野奢度假村 · 永鸿野生动物世界设计系统
   Forest Luxury Resort Design System
   ======================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap');

/* ── CSS Variables ── */
:root {
    /* Forest Green Palette */
    --forest-900: #0d1f12;
    --forest-800: #1a4d2e;
    --forest-700: #256d42;
    --forest-600: #3d8c5f;
    --forest-500: #5aac7a;

    /* Gold Accent */
    --gold: #d4a574;
    --gold-light: #e8c9a8;

    /* Neutral */
    --cream: #faf8f5;
    --cream-dark: #f0ebe3;
    --charcoal: #2a2a2a;

    /* Text */
    --text: #1a1a1a;
    --text-muted: #6b6b6b;

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

    /* Radius */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Shadows */
    --shadow-card:
        0 4px 24px rgba(13, 31, 18, 0.08),
        0 1px 3px rgba(13, 31, 18, 0.06);
    --shadow-card-hover:
        0 12px 40px rgba(13, 31, 18, 0.12),
        0 2px 8px rgba(13, 31, 18, 0.08);

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(255, 255, 255, 0.45);
    --glass-blur: blur(20px);

    /* Focus */
    --focus-ring: 3px solid var(--gold);
    --focus-offset: 2px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Dark Background Body ── */
body.dark-bg {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(37, 109, 66, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(212, 165, 116, 0.12) 0%, transparent 50%),
        linear-gradient(170deg, var(--forest-900) 0%, #112a18 40%, #0f2218 100%);
    color: #e8e4df;
    min-height: 100vh;
}

/* ── Glass Card ── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
    animation: cardFadeIn 0.5s var(--ease-out) both;
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
}

/* On dark background, use a slightly different glass */
.dark-bg .glass-card {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e8e4df;
}
.dark-bg .glass-card:hover {
    background: rgba(255, 255, 255, 0.10);
}

/* ── Card Fade In Animation ── */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Staggered animation for multiple cards */
.glass-card:nth-child(2) { animation-delay: 0.07s; }
.glass-card:nth-child(3) { animation-delay: 0.14s; }
.glass-card:nth-child(4) { animation-delay: 0.21s; }
.glass-card:nth-child(5) { animation-delay: 0.28s; }
.glass-card:nth-child(6) { animation-delay: 0.35s; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    border: none;
    outline: none;
}

.btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

/* Outline Button (transparent + border) */
.btn-outline {
    background: transparent;
    color: var(--forest-700);
    border: 1.5px solid var(--forest-600);
}
.btn-outline:hover {
    background: var(--forest-700);
    color: #fff;
    border-color: var(--forest-700);
}

/* Primary Button (forest green fill) */
.btn-primary {
    background: linear-gradient(135deg, var(--forest-700), var(--forest-600));
    color: #fff;
    border: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--forest-600), var(--forest-500));
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 109, 66, 0.3);
}

/* Gold accent button */
.btn-gold {
    background: linear-gradient(135deg, var(--gold), #c49460);
    color: #fff;
    border: none;
}
.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    transform: translateY(-1px);
}

/* Danger button */
.btn-danger {
    background: #c0392b;
    color: #fff;
    border: none;
}
.btn-danger:hover {
    background: #e74c3c;
    transform: translateY(-1px);
}

/* Secondary / muted button */
.btn-secondary {
    background: rgba(0,0,0,0.06);
    color: var(--text-muted);
    border: 1px solid rgba(0,0,0,0.1);
}
.btn-secondary:hover {
    background: rgba(0,0,0,0.10);
    color: var(--text);
}

.dark-bg .btn-secondary {
    background: rgba(255,255,255,0.08);
    color: #aaa;
    border-color: rgba(255,255,255,0.12);
}
.dark-bg .btn-secondary:hover {
    background: rgba(255,255,255,0.14);
    color: #ddd;
}

/* Small button */
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

/* Table action buttons */
.btn-sm + .btn-sm {
    margin-left: 6px;
}

/* 操作列按钮固定样式 */
.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}
.action-btns .btn-sm {
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 60px;
}

/* ── Tables ── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0,0,0,0.06);
}

.dark-bg .table-wrap {
    border-color: rgba(255,255,255,0.08);
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-wrap th {
    background: linear-gradient(135deg, var(--forest-800), var(--forest-700));
    color: #fff;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-wrap th:first-child { border-radius: var(--radius-md) 0 0 0; }
.table-wrap th:last-child { border-radius: 0 var(--radius-md) 0 0; }

.table-wrap td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.dark-bg .table-wrap td {
    border-bottom-color: rgba(255,255,255,0.06);
}

/* Zebra striping */
.table-wrap tr:nth-child(even) td {
    background: rgba(0,0,0,0.02);
}
.dark-bg .table-wrap tr:nth-child(even) td {
    background: rgba(255,255,255,0.03);
}

.table-wrap tr:hover td {
    background: rgba(37, 109, 66, 0.06);
}
.dark-bg .table-wrap tr:hover td {
    background: rgba(90, 172, 122, 0.08);
}

.table-wrap tr:last-child td {
    border-bottom: none;
}

/* ── Form Elements ── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid rgba(0,0,0,0.12);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    outline: none;
}

.form-control:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
    outline: var(--focus-ring);
    outline-offset: 0;
}

.dark-bg .form-control,
.dark-bg input[type="text"],
.dark-bg input[type="number"],
.dark-bg input[type="date"],
.dark-bg input[type="password"],
.dark-bg select,
.dark-bg textarea {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    color: #e8e4df;
}
.dark-bg .form-control:focus,
.dark-bg input:focus,
.dark-bg select:focus,
.dark-bg textarea:focus {
    border-color: var(--gold);
    background: rgba(255,255,255,0.08);
}

/* ── Section Headings ── */
.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--forest-700);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dark-bg .section-title {
    color: var(--gold-light);
}

/* ── Status Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-green  { background: rgba(37, 109, 66, 0.12); color: var(--forest-700); }
.badge-gold   { background: rgba(212, 165, 116, 0.18); color: #a67c52; }
.badge-red    { background: rgba(192, 57, 43, 0.10); color: #c0392b; }

.dark-bg .badge-green { background: rgba(90, 172, 122, 0.18); color: var(--forest-500); }
.dark-bg .badge-gold  { background: rgba(212, 165, 116, 0.15); color: var(--gold-light); }
.dark-bg .badge-red   { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}
.dark-bg ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
}
.dark-bg ::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* ── Utility ── */
.text-gold { color: var(--gold); }
.text-forest { color: var(--forest-700); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* ── Responsive Breakpoints ── */
@media (max-width: 900px) {
    .glass-card { padding: 18px; border-radius: var(--radius-md); }
    .hide-tablet { display: none !important; }
}

@media (max-width: 640px) {
    .glass-card { padding: 14px; border-radius: var(--radius-sm); }
    .hide-mobile { display: none !important; }
    .btn { padding: 8px 16px; font-size: 13px; }
    .table-wrap th, .table-wrap td { padding: 8px 10px; font-size: 12px; }
}

/* API Monitor Grid */
.api-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 1200px) { .api-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .api-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .api-grid { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════════
   系统信息面板 - 森林绿设计系统
   ═══════════════════════════════════════════════════════════════ */

/* 资源监测卡片 */
.hero-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.stat-pill {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    background: linear-gradient(160deg, rgba(26,77,46,0.6) 0%, rgba(13,31,18,0.7) 100%);
    border: 1px solid rgba(212,165,116,0.2);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
}

.stat-pill:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.stat-pill::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--gold);
}

.stat-pill[data-type="mem"]::before { background: #5aac7a; }
.stat-pill[data-type="disk"]::before { background: var(--gold); }
.stat-pill[data-type="load"]::before { background: #64b5c6; }
.stat-pill[data-type="uptime"]::before { background: #c9a0dc; }

.stat-pill .stat-icon {
    font-size: 18px;
    margin-bottom: 6px;
    opacity: 0.8;
}

.stat-pill .stat-content {
    flex: 1;
}

.stat-pill .stat-label {
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(232,228,223,0.5);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-pill .stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.stat-pill .stat-detail {
    font-size: 12px;
    color: rgba(232,228,223,0.6);
    margin-top: 6px;
    line-height: 1.5;
}

.stat-pill .stat-detail {
    font-size: 12px;
    color: rgba(232,228,223,0.6);
    margin-top: 6px;
    line-height: 1.5;
}

.stat-pill .stat-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.1);
}

.stat-pill .stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), rgba(212,165,116,0.4));
    transition: width 0.8s var(--ease-out);
}

/* Agent卡片 */
.agents-showcase {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.agent-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(160deg, rgba(26,77,46,0.5) 0%, rgba(13,31,18,0.6) 100%);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.agent-card:hover {
    border-color: rgba(212,165,116,0.4);
}

.agent-card.ikaros::after {
    content: '';
    position: absolute;
    top: -30%; right: -20%;
    width: 140px; height: 140px;
    background: radial-gradient(circle, rgba(90,172,122,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.agent-card.reisia::after {
    content: '';
    position: absolute;
    top: -30%; right: -20%;
    width: 140px; height: 140px;
    background: radial-gradient(circle, rgba(232,201,168,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.agent-avatar {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    flex-shrink: 0;
}

.agent-identity {
    flex: 1;
    min-width: 0;
}

.agent-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.agent-subtitle {
    font-size: 11px;
    color: rgba(232,228,223,0.45);
}

.agent-specs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 70px;
}

.spec {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
}

.spec-label {
    color: rgba(232,228,223,0.4);
}

.spec-value {
    color: var(--gold-light);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* 面板标题 */
.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.panel-icon {
    font-size: 16px;
    opacity: 0.7;
}

.panel-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--gold-light);
}

.panel-location {
    margin-left: auto;
    font-size: 11px;
    color: rgba(232,228,223,0.35);
}

.panel-action {
    margin-left: auto;
    width: 30px; height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: rgba(232,228,223,0.6);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.panel-action:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* 天气面板 */
.weather-panel {
    background: linear-gradient(160deg, rgba(26,77,46,0.4) 0%, rgba(13,31,18,0.5) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.forecast-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0;
}

.forecast-loading {
    color: rgba(232,228,223,0.3);
    font-size: 13px;
    padding: 14px;
    text-align: center;
    width: 100%;
}

/* 天气卡片 */
.weather-day-card {
    flex: 0 0 auto;
    width: 68px;
    padding: 10px 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
}

.weather-day-card:hover {
    background: rgba(255,255,255,0.08);
}

.weather-day-card.today {
    background: rgba(212,165,116,0.15);
    border-color: rgba(212,165,116,0.35);
}

.day-name {
    font-size: 10px;
    color: rgba(232,228,223,0.5);
    font-weight: 600;
}

.day-icon {
    font-size: 22px;
    margin: 6px 0;
}

.day-temp {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.day-weather {
    font-size: 10px;
    color: rgba(232,228,223,0.4);
    margin-top: 3px;
    line-height: 1.2;
}

/* 服务监控面板 */
.monitor-panel {
    background: linear-gradient(160deg, rgba(26,77,46,0.4) 0%, rgba(13,31,18,0.5) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

@media (max-width: 1000px) { .service-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }

.service-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    transition: all 0.2s;
}

.service-node:hover {
    background: rgba(255,255,255,0.04);
}

.service-node.offline {
    border-color: rgba(231,76,60,0.35);
    background: rgba(231,76,60,0.1);
}

.node-indicator {
    font-size: 11px;
    margin-bottom: 4px;
}

.node-indicator.online { color: #5aac7a; }
.node-indicator.offline { color: #e74c3c; }
.node-indicator.loading { color: #888; }

.node-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(232,228,223,0.65);
    text-align: center;
    margin-bottom: 3px;
}

.node-latency {
    font-size: 9px;
    color: rgba(232,228,223,0.3);
    font-variant-numeric: tabular-nums;
}

/* 大模型API面板 */
.llm-panel {
    background: linear-gradient(160deg, rgba(26,77,46,0.4) 0%, rgba(13,31,18,0.5) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.llm-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.llm-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    transition: all 0.2s;
}

.llm-node:hover {
    background: rgba(255,255,255,0.07);
}

.llm-node.offline {
    border-color: rgba(231,76,60,0.3);
}

.llm-dot {
    font-size: 9px;
}

.llm-dot.online { color: #5aac7a; }
.llm-dot.offline { color: #e74c3c; }

.llm-name {
    font-size: 11px;
    font-weight: 600;
    color: rgba(232,228,223,0.7);
}

/* 响应式 */
@media (max-width: 700px) {
    .agents-showcase { grid-template-columns: 1fr; }
    .hero-stats { flex-wrap: wrap; }
    .stat-pill { min-width: calc(50% - 6px); }
}

@media (max-width: 400px) {
    .stat-pill { min-width: 100%; }
}
