/* 联合国日志系统 - 莫兰迪双主题 UI 系统 */

:root {
    /* ========== 默认浅色主题 (Morandi Light) ========== */

    /* 核心背景色 */
    --bg-primary: #f4f7f6;    /* 极浅灰蓝背景 */
    --bg-secondary: #ffffff;  /* 纯白卡片背景 */
    --bg-tertiary: #e9ecef;   /* 悬浮/激活态 */
    --bg-card: rgba(255, 255, 255, 0.85); /* 毛玻璃卡片基色 */

    /* 文本颜色 - 深灰主导 */
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;

    /* 边框与阴影 */
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 10px rgba(0, 0, 0, 0.05);

    /* 品牌色 - 莫兰迪色系 (通透感) */
    --brand-primary: #74b9ff;
    --panda-green: #55efc4;   /* 浅薄荷绿 */
    --cow-blue: #74b9ff;      /* 浅天蓝 */
    --pig-pink: #fd79a8;      /* 浅粉 */

    /* 功能色 */
    --accent-info: #81ecec;
    --accent-warning: #ffeaa7;
    --accent-danger: #fab1a0;
    --accent-success: #55efc4;

    /* 圆角 */
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 24px;
}

/* ========== 深色模式 (Morandi Dark) ========== */
[data-theme="dark"] {
    --bg-primary: #2b2d42;    /* 深枪灰 */
    --bg-secondary: #35394a;  /* 雾霾深灰 */
    --bg-tertiary: #4a506a;
    --bg-card: rgba(53, 57, 74, 0.85);

    --text-primary: #edf2f4;
    --text-secondary: #8d99ae;
    --text-muted: #636e72;

    --border-color: rgba(255, 255, 255, 0.06);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 15px rgba(255, 255, 255, 0.05);

    /* 深色模式下的品牌色 (降低亮度) */
    --panda-green: #00b894;
    --cow-blue: #0984e3;
    --pig-pink: #e84393;
}

/* 全局重置 */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

main {
    flex: 1;
    padding-bottom: 3rem;
}

a {
    text-decoration: none;
    transition: all 0.2s;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    opacity: 0.9;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: background 0.3s;
    z-index: 1030;
    position: relative;
}

.navbar .dropdown-menu {
    z-index: 1050;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
}

.navbar .dropdown-menu .dropdown-item {
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* 汉堡菜单按钮在浅色背景上可见 */
.navbar-toggler {
    border-color: var(--border-color);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(45, 52, 54, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
[data-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(237, 242, 244, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="dark"] .navbar {
    background: rgba(43, 45, 66, 0.85) !important;
}

.navbar-brand {
    color: var(--text-primary) !important;
    font-weight: 800;
    font-size: 1.4rem;
}

.navbar-brand i {
    color: var(--cow-blue);
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary) !important;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

/* 卡片组件 */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

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

.card-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.2rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* 阵营卡片 */
.faction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
}

.border-success.faction-card::before { background: var(--panda-green); }
.border-primary.faction-card::before { background: var(--cow-blue); }
.border-danger.faction-card::before { background: var(--pig-pink); }

/* 模块入口卡片 */
.module-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
}

.module-card:hover {
    background: var(--bg-tertiary);
}

.module-card i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--brand-primary);
    transition: transform 0.3s;
}

.module-card:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* 按钮 - 莫兰迪色 */
.btn {
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 浅色模式下的按钮颜色需深一点以保证对比度 */
.btn-primary { background: #74b9ff; color: #fff; }
[data-theme="dark"] .btn-primary { background: #0984e3; }

.btn-success { background: #55efc4; color: #2d3436; }
[data-theme="dark"] .btn-success { background: #00b894; color: #fff; }

.btn-danger { background: #fab1a0; color: #2d3436; }
[data-theme="dark"] .btn-danger { background: #d63031; color: #fff; }

.btn-warning { background: #ffeaa7; color: #2d3436; }
[data-theme="dark"] .btn-warning { background: #fdcb6e; }

.btn-outline-primary {
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--brand-primary);
    color: #fff;
}

/* 表单元素 */
.form-control, .form-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
}

.form-control:focus, .form-select:focus {
    background: var(--bg-secondary);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(116, 185, 255, 0.2);
    color: var(--text-primary);
}

/* 表格 */
.table { color: var(--text-primary); border-color: var(--border-color); }
.table thead th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-bottom-width: 1px;
}
.table td { border-bottom-color: var(--border-color); }
.table-hover tbody tr:hover { background: var(--bg-tertiary); }

/* 模态框 */
.modal-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}
.modal-header, .modal-footer { border-color: var(--border-color); }
.btn-close { filter: none; }
[data-theme="dark"] .btn-close { filter: invert(1); }

/* 徽章 */
.badge { padding: 0.5em 0.8em; font-weight: 600; }

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

/* 页脚 */
footer {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary) !important;
}

/* 主题切换按钮 */
.theme-toggle {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s;
}
.theme-toggle:hover {
    background: var(--bg-tertiary);
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* 辅助类 */
.text-muted { color: var(--text-muted) !important; }

/* ========== Mobile Responsive ========== */
@media (max-width: 768px) {
    /* 导航栏 */
    .navbar {
        padding: 0.5rem 0;
    }
    .navbar-brand {
        font-size: 1.1rem;
    }
    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem !important;
    }

    /* 页面标题 */
    h1 {
        font-size: 1.4rem !important;
    }
    h2 {
        font-size: 1.2rem !important;
    }

    /* 卡片 */
    .card {
        border-radius: var(--radius-sm);
        margin-bottom: 1rem;
    }
    .card:hover {
        transform: none;
    }
    .card-body {
        padding: 1rem;
    }
    .card-header {
        padding: 0.8rem 1rem;
    }

    /* 模块卡片 */
    .module-card {
        padding: 1.5rem 1rem;
    }
    .module-card i {
        font-size: 2.5rem;
    }

    /* 按钮 */
    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    .btn:hover {
        transform: none;
    }

    /* 表格容器 */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    .table {
        font-size: 0.8rem;
    }
    .table th, .table td {
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }

    /* 页脚 */
    footer {
        padding: 1rem 0 !important;
    }

    /* 容器内边距 */
    main.container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* 模态框 */
    .modal-dialog {
        margin: 0.5rem;
    }

    /* 徽章 */
    .badge {
        padding: 0.3em 0.5em;
        font-size: 0.75em;
    }
}

@media (max-width: 576px) {
    /* 极小屏幕额外调整 */
    .navbar-brand {
        font-size: 1rem;
    }
    .btn-group .btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }
    main.container {
        padding-left: 6px;
        padding-right: 6px;
    }
}

