/**
 * Grand Archive 基础样式
 * 包含全局重置、字体、颜色变量、基础布局
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base, 'Noto Sans SC', sans-serif);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--bg-primary, #0a0a0a);
    color: var(--text-primary, #e0e0e0);
    line-height: 1.6;
}

a {
    color: var(--text-link, #667eea);
    text-decoration: none;
    transition: color var(--transition-fast, 0.15s ease);
}

a:hover {
    color: var(--text-link-hover, #764ba2);
}

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

button {
    font-family: inherit;
    cursor: pointer;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

.container {
    max-width: var(--layout-wide-max-width, 1600px);
    margin: 0 auto;
    padding: 0 var(--spacing-md, 16px);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-sm, 8px); }
.mt-2 { margin-top: var(--spacing-md, 16px); }
.mt-3 { margin-top: var(--spacing-lg, 24px); }
.mt-4 { margin-top: var(--spacing-xl, 32px); }

.mb-1 { margin-bottom: var(--spacing-sm, 8px); }
.mb-2 { margin-bottom: var(--spacing-md, 16px); }
.mb-3 { margin-bottom: var(--spacing-lg, 24px); }
.mb-4 { margin-bottom: var(--spacing-xl, 32px); }

.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* 主内容区 - 与导航栏对齐约束 */
.main-content {
    padding-top: 80px;
    min-height: 100vh;
    /* 布局约束：与导航栏内容区域对齐 */
    max-width: var(--layout-wide-max-width, 1600px);
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* 页面宽度分层：列表/展示页走 wide，表单/单栏页可切 narrow。 */
.main-content.layout-wide-page {
    max-width: var(--layout-wide-max-width, 1600px);
}

.main-content.layout-narrow-page {
    max-width: var(--layout-narrow-max-width, 960px);
}

/* 确保内容不会贴边 */
.main-content > * {
    max-width: 100%;
}

@media (max-width: 768px) {
    .main-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }
}

.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm, 8px);
    }
}

/* ===== 效果文本规则化着色 - 全站统一 ===== */
/* 覆盖 .effect-text (card_detail) 和 .card-effect-text (deck_builder) 两种容器 */
/* 重要：只改变颜色，不改变排版 */

/* 触发标签 - 金色 */
.effect-text .effect-trigger,
.card-effect-text .effect-trigger {
    color: #ffd700;
    font-weight: 700;
}

/* 段落标签 - 金色 */
.effect-text .effect-label,
.card-effect-text .effect-label {
    color: #ffd700;
    font-weight: 700;
}

/* 能力词 - 青色 */
.effect-text .effect-keyword,
.card-effect-text .effect-keyword {
    color: #00ffff;
    font-weight: 700;
}

/* 费用标记 - 黄色 */
.effect-text .effect-cost,
.card-effect-text .effect-cost {
    color: #ffff00;
    font-weight: 700;
}

/* Lineage 标题 - 金色 */
.effect-text .effect-lineage,
.card-effect-text .effect-lineage {
    color: #ffd700;
    font-weight: 700;
}

/* ===== PC Footer Disclaimer ===== */
.ga-pc-disclaimer {
    display: none;
}

@media (min-width: 769px) {
    .ga-pc-disclaimer {
        display: block;
        max-width: var(--layout-wide-max-width, 1600px);
        margin: 0 auto;
        padding: 0 2rem 1.25rem;
    }

    .ga-pc-disclaimer-text {
        margin: 0;
        font-size: 0.875rem;
        line-height: 1.5;
        color: rgba(224, 224, 224, 0.72);
        text-align: center;
    }
}
