/* ========================================
   Navigation Site - Styles
   Design: Warm minimalist, paper-like
   ======================================== */

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

:root {
    --bg: #FAFAF8;
    --card-bg: #FFFFFF;
    --text-primary: #2D2D2D;
    --text-secondary: #8C8C8C;
    --accent: #C4956A;
    --accent-hover: #B07D54;
    --border: #E8E6E3;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.06);
    --transition: cubic-bezier(0.23, 1, 0.32, 1);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Noto Sans SC', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Page wrapper */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.site-header {
    padding: 80px 0 48px;
    text-align: center;
    animation: fadeInUp 0.5s var(--transition) both;
}

.site-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}

.site-desc {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 480px;
    margin: 0 auto;
}

/* Navigation Grid */
.main-content {
    flex: 1;
    padding-bottom: 80px;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Nav Card */
.nav-card {
    position: relative;
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.3s var(--transition),
                box-shadow 0.3s var(--transition),
                border-color 0.3s var(--transition);
    animation: fadeInUp 0.4s var(--transition) both;
}

.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.nav-card:active {
    transform: translateY(-2px) scale(0.98);
}

.nav-card-inner {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-card-index {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.nav-card-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s var(--transition);
}

.nav-card:hover .nav-card-title {
    color: var(--accent);
}

.nav-card-arrow {
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--text-secondary);
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: all 0.3s var(--transition);
}

.nav-card:hover .nav-card-arrow {
    opacity: 1;
    transform: translate(0, 0);
    color: var(--accent);
}

.nav-card-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--transition);
}

.nav-card:hover .nav-card-accent {
    transform: scaleX(1);
}

/* Footer */
.site-footer {
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.site-footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--accent);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Admin Styles */
.admin-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 20px;
    font-weight: 600;
}

.admin-header nav {
    display: flex;
    gap: 24px;
}

.admin-header nav a {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.admin-header nav a:hover,
.admin-header nav a.active {
    color: var(--accent);
}

.admin-main {
    flex: 1;
    padding: 40px 0;
}

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.3s var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Chart */
.chart-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 40px;
}

.chart-container h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 160px;
    padding-top: 20px;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-wrapper {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 100%;
}

.chart-bar {
    width: 20px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.4s var(--transition);
    opacity: 0.8;
}

.chart-bar.uv {
    background: var(--border);
    opacity: 1;
}

.chart-bar:hover {
    opacity: 1;
}

.chart-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
}

.chart-legend {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    justify-content: center;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

/* Form Styles */
.form-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
}

.form-section h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.link-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
    padding: 16px;
    background: var(--bg);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.link-row .form-group {
    margin-bottom: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s var(--transition);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: transparent;
    color: #d44;
    border: 1px solid #ecc;
    padding: 8px 12px;
    font-size: 13px;
}

.btn-danger:hover {
    background: #fef0f0;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    width: 100%;
    max-width: 380px;
    animation: fadeInUp 0.4s var(--transition) both;
}

.login-card h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.login-card .login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
}

.login-card .form-group {
    margin-bottom: 20px;
}

.login-card .btn {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
}

.error-msg {
    background: #fef0f0;
    border: 1px solid #ecc;
    color: #c44;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

.success-msg {
    background: #f0faf4;
    border: 1px solid #cde;
    color: #2a7a4b;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s var(--transition);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 3px solid #2a7a4b;
}

.toast.error {
    border-left: 3px solid #c44;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header {
        padding: 48px 0 32px;
    }

    .site-title {
        font-size: 26px;
    }

    .nav-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .link-row {
        grid-template-columns: 1fr;
    }

    .chart-bars {
        gap: 8px;
    }

    .chart-bar {
        width: 14px;
    }

    .admin-header .container {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 32px 24px;
    }
}
