/* 主样式文件 - 导入所有CSS模块 */

/* 1. 模块导入 */
@import url('./base/reset.css');
@import url('./base/animations.css');
@import url('./components/navigation.css');
@import url('./components/cards.css');
@import url('./components/buttons.css');
@import url('./components/timeline.css');
@import url('./interactions/rating.css');
@import url('./interactions/comments.css');
@import url('./interactions/interactions.css');
@import url('./responsive/mobile.css');
@import url('./responsive/tablet.css');

/* 2. CSS变量定义 - Primer Design System */
:root {
    /* Primer Foreground Colors */
    --fgColor-default: #1f2328;
    --fgColor-muted: #59636e;
    --fgColor-subtle: #818b98;
    --fgColor-accent: #0969da;
    --fgColor-success: #1a7f37;
    --fgColor-danger: #d1242f;
    --fgColor-attention: #9a6700;
    --fgColor-onEmphasis: #ffffff;
    --fgColor-link: #0969da;

    /* Primer Background Colors */
    --bgColor-default: #ffffff;
    --bgColor-muted: #f6f8fa;
    --bgColor-inset: #f6f8fa;
    --bgColor-emphasis: #25292e;
    --bgColor-accent-emphasis: #0969da;
    --bgColor-accent-muted: #ddf4ff;
    --bgColor-success-emphasis: #1f883d;
    --bgColor-success-muted: #dafbe1;
    --bgColor-danger-emphasis: #cf222e;
    --bgColor-danger-muted: #ffebe9;
    --bgColor-attention-emphasis: #9a6700;
    --bgColor-attention-muted: #fff8c5;

    /* Primer Border Colors */
    --borderColor-default: #d1d9e0;
    --borderColor-muted: rgba(209, 217, 224, 0.7);
    --borderColor-emphasis: #818b98;
    --borderColor-accent-emphasis: #0969da;
    --borderColor-success-emphasis: #1a7f37;
    --borderColor-danger-emphasis: #cf222e;

    /* Primer Shadows */
    --shadow-resting-xsmall: 0 1px 0 rgba(31, 35, 40, 0.04);
    --shadow-resting-small: 0 1px 0 rgba(31, 35, 40, 0.04), 0 1px 3px rgba(31, 35, 40, 0.12);
    --shadow-resting-medium: 0 3px 6px rgba(140, 149, 159, 0.15);
    --shadow-floating-small: 0 0 0 1px rgba(209, 217, 224, 0.5), 0 6px 12px -3px rgba(37, 41, 46, 0.04), 0 6px 18px 0 rgba(37, 41, 46, 0.12);
    --shadow-floating-medium: 0 0 0 1px rgba(209, 217, 224, 0.5), 0 8px 16px -4px rgba(37, 41, 46, 0.08), 0 4px 32px -4px rgba(37, 41, 46, 0.08);
    --shadow-floating-large: 0 0 0 1px rgba(209, 217, 224, 0.5), 0 40px 80px 0 rgba(37, 41, 46, 0.24);

    /* Primer Border Radius */
    --borderRadius-small: 4px;
    --borderRadius-medium: 6px;
    --borderRadius-large: 8px;
    --borderRadius-full: 9999px;

    /* Primer Focus */
    --focus-outlineColor: #0969da;

    /* Primer Button Colors */
    --button-primary-bgColor-rest: #0969da;
    --button-primary-bgColor-hover: #0550ae;
    --button-primary-bgColor-active: #033d8b;
    --button-primary-fgColor: #ffffff;
    --button-default-bgColor-rest: #ffffff;
    --button-default-bgColor-hover: #f3f4f6;
    --button-default-fgColor: #1f2328;
    --button-default-borderColor: #d1d9e0;
    --button-danger-fgColor-rest: #d1242f;
    --button-danger-bgColor-hover: #cf222e;
    --button-outline-fgColor: #0969da;

    /* Legacy aliases (for backward compat during migration) */
    --primary-color: #0969da;
    --secondary-color: #59636e;
    --success-color: #1f883d;
    --danger-color: #d1242f;
    --warning-color: #9a6700;
    --info-color: #0969da;
    --light-color: #f6f8fa;
    --dark-color: #1f2328;
    --text-primary: #1f2328;
    --text-secondary: #59636e;
    --text-muted: #818b98;
    --text-light: #ffffff;
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #f6f8fa;
    --border-color: #d1d9e0;
    --border-light: rgba(209, 217, 224, 0.7);
    --shadow-sm: var(--shadow-resting-small);
    --shadow: var(--shadow-resting-medium);
    --shadow-lg: var(--shadow-floating-small);
    --border-radius: 6px;
    --border-radius-sm: 4px;
    --border-radius-lg: 8px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 48px;
}

/* 3. 其他通用样式 */
/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    list-style: none;
    padding: 0;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--fgColor-default);
    text-decoration: none;
    border: 1px solid var(--borderColor-default);
    border-radius: var(--borderRadius-medium);
    transition: background-color 0.15s ease, border-color 0.15s ease;
    background: var(--bgColor-muted);
}

.page-link:hover {
    background: var(--bgColor-accent-emphasis);
    color: var(--fgColor-onEmphasis);
    border-color: var(--bgColor-accent-emphasis);
    text-decoration: none;
}

.page-item.active .page-link {
    background: var(--bgColor-accent-emphasis);
    color: var(--fgColor-onEmphasis);
    border-color: var(--bgColor-accent-emphasis);
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: var(--bgColor-default);
    border: 1px solid var(--borderColor-default);
    border-radius: var(--borderRadius-medium);
    overflow: hidden;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--borderColor-default);
}

.table th {
    background: var(--bgColor-muted);
    color: var(--fgColor-default);
    font-weight: 600;
}

.table td {
    color: var(--fgColor-muted);
}

.table tbody tr:hover {
    background: var(--bgColor-muted);
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--borderRadius-medium);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    background: var(--bgColor-default);
    border: 1px solid var(--borderColor-default);
    border-radius: var(--borderRadius-large);
    box-shadow: var(--shadow-floating-large);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content {
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--borderColor-default);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--borderColor-default);
}

/* 页脚样式 */
.footer {
    background: var(--bgColor-muted);
    border-top: 1px solid var(--borderColor-default);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
    position: relative;
    min-height: 200px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-section p,
.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 1.6;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--borderColor-default);
    color: var(--fgColor-subtle);
}

/* 错误页面样式 */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.error-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: var(--bgColor-emphasis);
    color: var(--fgColor-onEmphasis);
    text-align: center;
    border-radius: var(--borderRadius-medium);
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.15s;
    font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 加载状态样式 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--borderColor-muted);
    border-top: 4px solid var(--fgColor-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 2rem;
}

/* 成功状态样式 */
.success-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--success-color);
}

.success-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.success-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}
