/* ============================================================
   GPRI 地缘政治风险指数网站 - 样式表
   主题色调：蓝色系
   ============================================================ */

/* --- 基础变量 --- */
:root {
    --primary:        #1565C0;
    --primary-dark:   #0D47A1;
    --primary-light:  #42A5F5;
    --primary-pale:   #BBDEFB;
    --accent:         #1976D2;
    --bg-body:        #F5F8FA;
    --bg-white:       #FFFFFF;
    --bg-card:        #FFFFFF;
    --bg-hero:        linear-gradient(135deg, #0D47A1 0%, #1565C0 40%, #1976D2 70%, #42A5F5 100%);
    --text-primary:   #1A2332;
    --text-secondary: #546E7A;
    --text-light:     #90A4AE;
    --border:         #E3E8EE;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg:      0 8px 24px rgba(0,0,0,0.16);
    --radius:         8px;
    --radius-lg:      12px;
    --transition:     0.3s ease;
}

/* --- 重置与基础 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* --- 容器 --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* --- 导航栏 --- */
.navbar {
    background: var(--primary-dark);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 4px;
}

.navbar-nav a {
    color: rgba(255,255,255,0.85);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.navbar-nav a.active {
    background: rgba(255,255,255,0.25);
}

/* --- Hero 区域 --- */
.hero {
    background: var(--bg-hero);
    color: #fff;
    padding: 60px 0 50px;
    text-align: center;
}

.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.hero .subtitle {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 24px;
}

.hero .period-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.hero .hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

/* --- 按钮 --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-align: center;
}

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

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.5);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); border-color: #fff; }

.btn-light { background: rgba(255,255,255,0.9); color: var(--primary-dark); }
.btn-light:hover { background: #fff; }

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-danger { background: #D32F2F; color: #fff; }
.btn-danger:hover { background: #B71C1C; }
.btn-success { background: #388E3C; color: #fff; }
.btn-success:hover { background: #2E7D32; }

/* --- 卡片 --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.card-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-pale);
}

/* --- 指数指标卡片 --- */
.index-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: all var(--transition);
}

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

.index-card.risk-extreme  { border-left-color: #8B0000; }
.index-card.risk-high     { border-left-color: #D32F2F; }
.index-card.risk-medium   { border-left-color: #F57C00; }
.index-card.risk-low      { border-left-color: #388E3C; }
.index-card.risk-very-low { border-left-color: #1B5E20; }

.index-card .region-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.index-card .index-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.index-card .risk-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 6px;
}

.risk-badge.risk-extreme  { background: #FFEBEE; color: #8B0000; }
.risk-badge.risk-high     { background: #FFEBEE; color: #D32F2F; }
.risk-badge.risk-medium   { background: #FFF3E0; color: #F57C00; }
.risk-badge.risk-low      { background: #E8F5E9; color: #388E3C; }
.risk-badge.risk-very-low { background: #E8F5E9; color: #1B5E20; }

/* --- 网格布局 --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* --- 区段 --- */
.section {
    padding: 40px 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 24px;
}

.section-title .icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: var(--primary-pale);
    border-radius: 6px;
    text-align: center;
    line-height: 32px;
    margin-right: 10px;
    font-size: 0.9rem;
}

/* --- 表格 --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

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

.data-table tr:hover td { background: var(--primary-pale); }

/* --- 文档列表 --- */
.doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    transition: all var(--transition);
}

.doc-item:hover {
    box-shadow: var(--shadow-md);
}

.doc-item .doc-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
}

.doc-icon.pdf  { background: #FFEBEE; color: #D32F2F; }
.doc-icon.doc  { background: #E3F2FD; color: #1565C0; }
.doc-icon.xls  { background: #E8F5E9; color: #388E3C; }
.doc-icon.zip  { background: #FFF3E0; color: #F57C00; }
.doc-icon.other { background: #F5F5F5; color: #757575; }

.doc-item .doc-info { flex: 1; }
.doc-item .doc-title { font-weight: 600; font-size: 0.95rem; }
.doc-item .doc-meta { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; }
.doc-item .doc-actions { display: flex; gap: 8px; }

/* --- 页面头部横幅 --- */
.page-banner {
    background: var(--bg-hero);
    color: #fff;
    padding: 40px 0 32px;
    text-align: center;
}

.page-banner h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.page-banner p {
    font-size: 1rem;
    opacity: 0.85;
}

/* --- 内容区 --- */
.content-area {
    padding: 40px 0;
}

.content-block {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.content-block h2 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-pale);
}

.content-block h3 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 12px;
    margin-top: 20px;
}

.content-block p {
    margin-bottom: 12px;
    line-height: 1.8;
}

.content-block ul, .content-block ol {
    margin-bottom: 12px;
    padding-left: 24px;
}

.content-block li {
    margin-bottom: 6px;
    line-height: 1.7;
}

/* --- 团队成员卡片 --- */
.team-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all var(--transition);
}

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

.team-card .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: var(--primary);
}

.team-card .name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.team-card .title-text {
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.team-card .institution {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.team-card .bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- 参考资料列表 --- */
.ref-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ref-item:last-child { border-bottom: none; }

.ref-item .ref-year {
    background: var(--primary-pale);
    color: var(--primary-dark);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.ref-item .ref-info { flex: 1; }
.ref-item .ref-title { font-weight: 600; font-size: 0.95rem; }
.ref-item .ref-authors { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }
.ref-item .ref-source { font-size: 0.85rem; color: var(--text-light); margin-top: 2px; }

/* --- 图表容器 --- */
.chart-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.chart-container canvas {
    max-height: 400px;
}

/* --- 警告/提示 --- */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.alert-info { background: #E3F2FD; color: #0D47A1; border-left: 4px solid #1565C0; }
.alert-success { background: #E8F5E9; color: #1B5E20; border-left: 4px solid #388E3C; }
.alert-warning { background: #FFF3E0; color: #E65100; border-left: 4px solid #F57C00; }
.alert-danger { background: #FFEBEE; color: #B71C1C; border-left: 4px solid #D32F2F; }

/* --- 表单 --- */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color var(--transition);
    background: var(--bg-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

select.form-control { cursor: pointer; }

textarea.form-control { min-height: 100px; resize: vertical; }

.form-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.form-inline .form-group { flex: 1; }

/* --- 管理后台 --- */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.admin-sidebar {
    width: 240px;
    background: var(--primary-dark);
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-sidebar .sidebar-header {
    padding: 12px 20px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 1px;
}

.admin-sidebar .sidebar-menu {
    list-style: none;
}

.admin-sidebar .sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.admin-sidebar .sidebar-menu a:hover,
.admin-sidebar .sidebar-menu a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.admin-content {
    flex: 1;
    padding: 30px;
    background: var(--bg-body);
}

.admin-content .page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

/* --- 登录页 --- */
.login-box {
    max-width: 420px;
    margin: 80px auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-box h2 {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 24px;
}

.login-box .logo-icon {
    text-align: center;
    margin-bottom: 16px;
    font-size: 2.5rem;
    color: var(--primary);
}

/* --- 页脚 --- */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    padding: 32px 0;
    margin-top: 40px;
}

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

.footer-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    transition: color var(--transition);
}

.footer-links a:hover { color: #fff; }

.footer .copyright {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

/* --- 工具栏 --- */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.toolbar .filter-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* --- 状态指示 --- */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.published { background: #388E3C; }
.status-dot.unpublished { background: #9E9E9E; }

/* --- 响应式 --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.6rem; }
    .navbar .container { flex-wrap: wrap; height: auto; padding: 12px 20px; }
    .navbar-nav { flex-wrap: wrap; gap: 2px; }
    .navbar-nav a { padding: 6px 10px; font-size: 0.85rem; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .footer .container { flex-direction: column; gap: 16px; text-align: center; }
    .hero .hero-actions { flex-direction: column; }
}

@media (max-width: 480px) {
    .card { padding: 16px; }
    .content-block { padding: 20px; }
    .index-card { padding: 16px; }
    .index-card .index-value { font-size: 1.5rem; }
}

/* --- 加载动画 --- */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(21,101,192,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- 分页 --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    border: 1px solid var(--border);
}

.pagination a:hover { background: var(--primary-pale); }

.pagination .current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
