/* ==========================================================================
   Kinetel Scraper 管理平台样式
   ========================================================================== */

/* --------------------------------------------------------------------------
   基础样式
   -------------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background-color: #f5f7fa;
    color: #333;
}

h1, h2, h3 {
    margin-top: 0;
    color: #1a1a2e;
}

h1 {
    font-size: 24px;
    margin-bottom: 24px;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 16px;
}

a {
    color: #4a90d9;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    background: #e8e8e8;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   布局
   -------------------------------------------------------------------------- */

.page {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 0;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.sidebar-header p {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.logout-link {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: all 0.2s;
}

.logout-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

/* 认证加载状态 */
.loading-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-size: 16px;
    color: #666;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 16px 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.nav-menu a.active {
    background: rgba(74, 144, 217, 0.3);
    color: white;
    border-left: 3px solid #4a90d9;
}

.nav-menu .icon {
    margin-right: 12px;
    font-size: 16px;
}

/* 导航分组标题 */
.nav-menu .nav-section {
    padding: 16px 20px 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
}

/* 主内容区 */
.content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* --------------------------------------------------------------------------
   首页卡片
   -------------------------------------------------------------------------- */

.welcome-card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.welcome-card h2 {
    margin-bottom: 8px;
}

.welcome-card p {
    color: #666;
    margin: 0;
}

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

.feature-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.feature-card h3 {
    margin-bottom: 12px;
}

.feature-card p {
    color: #666;
    margin-bottom: 12px;
}

.feature-card ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.feature-card li {
    margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: #4a90d9;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #3a7bc8;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   测试页面
   -------------------------------------------------------------------------- */

.test-panel {
    background: white;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.control-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.control-section label {
    font-weight: 500;
    color: #555;
}

.control-section select {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 280px;
    background: white;
}

.control-section select:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

/* 日志区域 */
.log-section {
    background: white;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.log-container {
    background: #1a1a2e;
    border-radius: 6px;
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.log-item {
    padding: 4px 0;
    color: #aaa;
}

.log-item.info {
    color: #7ec8e3;
}

.log-item.success {
    color: #98c379;
}

.log-item.error {
    color: #e06c75;
}

.log-time {
    color: #666;
    margin-right: 12px;
}

/* 结果区域 */
.result-section {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.result-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.result-summary.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.result-summary.error {
    background: #ffebee;
    color: #c62828;
}

.result-summary .divider {
    color: rgba(0, 0, 0, 0.2);
}

.result-summary .error-msg {
    color: #c62828;
}

/* 球队表格 */
.team-table {
    width: 100%;
    border-collapse: collapse;
}

.team-table th,
.team-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.team-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.team-table tr:hover {
    background: #f8f9fa;
}

/* --------------------------------------------------------------------------
   加载动画
   -------------------------------------------------------------------------- */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .page {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .content {
        padding: 20px;
    }

    .control-section {
        flex-direction: column;
        align-items: stretch;
    }

    .control-section select {
        min-width: auto;
    }
}
