/* ==================== 全局样式 ==================== */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --radius: 12px;
    --transition: 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f6f8fc 0%, #eef2f7 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-dark);
}

/* ==================== 容器 ==================== */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* ==================== 顶部栏 ==================== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.top-bar h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: var(--shadow-sm);
}

.user-area span {
    font-weight: 500;
    color: var(--text-dark);
}

.logout-link {
    color: var(--danger);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.logout-link:hover {
    color: #b91c1c;
}

/* ==================== 平台导航 ==================== */
.platform-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.platform-nav a {
    padding: 10px 24px;
    background: var(--card-bg);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid transparent;
}

.platform-nav a:hover {
    background: #f8fafc;
    color: var(--text-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.platform-nav a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(79,70,229,0.3);
}

/* ==================== 副标题 ==================== */
.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

/* ==================== 卡片通用 ==================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 25px;
    margin-bottom: 25px;
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.card h2 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== 输入区域 ==================== */
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 15px;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s ease;
    min-width: 120px;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-clear {
    background: #f1f5f9;
    color: var(--text-dark);
}

.btn-clear:hover {
    background: #e2e8f0;
}

/* ==================== 状态提示 ==================== */
.status {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--success);
    min-height: 24px;
    transition: all var(--transition);
}

/* ==================== 表格区域 ==================== */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-header h2 {
    margin-bottom: 0;
}

.btn-export {
    background: var(--success);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition), transform 0.1s ease;
    white-space: nowrap;
}

.btn-export:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.btn-export:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: white;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

td {
    color: #334155;
}

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

tr:hover td {
    background-color: #f9fafb;
}

/* ==================== 状态类 ==================== */
.processing {
    color: var(--warning);
    font-style: italic;
}

.found {
    color: var(--success);
    font-weight: 500;
}

.limit-reached {
    color: var(--danger);
    font-weight: 500;
}

.not-found {
    color: var(--danger);
}

/* ==================== 空提示 ==================== */
.empty-tip {
    text-align: center;
    color: #94a3b8;
    padding: 30px 0;
    display: none;
}

/* ==================== 登录页样式 ==================== */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 380px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-dark);
    font-size: 1.8rem;
}

.login-box input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 18px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color var(--transition);
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.login-box button:hover {
    background: var(--primary-hover);
}

.login-box .error {
    color: var(--danger);
    text-align: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* ==================== 响应式 ==================== */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .top-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .user-area {
        justify-content: center;
    }
    .platform-nav a {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    .card {
        padding: 18px;
    }
    th, td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    .btn-group {
        flex-direction: column;
    }
    .btn {
        width: 100%;
    }
}