/* ==========================================================
   Apex Legends 账号管理 - 样式
   ========================================================== */

* {
    box-sizing: border-box;
}

:root {
    --red: #d93636;
    --red-dark: #b92d2d;
    --dark: #1b1d21;
    --border: #e6e8eb;
    --text: #222;
    --muted: #777;
    --bg: #f5f6f8;
}

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================
   顶部导航
   ========================================================== */

.header {
    height: 70px;
    background: var(--dark);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 30px;
}

.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
}

.logo-icon {
    font-size: 24px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: #bbb;
}

.header-user button {
    border: 1px solid #444;
    background: transparent;
    color: #ddd;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.header-user button:hover {
    background: #2c2f35;
    color: #fff;
}

/* ==========================================================
   布局
   ========================================================== */

.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-title {
    margin: 0 0 6px;
    font-size: 26px;
}

.page-description {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================
   按钮
   ========================================================== */

.btn {
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, opacity .15s;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--red-dark);
}

.btn-secondary {
    background: #eceef1;
    color: #444;
}

.btn-secondary:hover:not(:disabled) {
    background: #dfe2e6;
}

.btn-danger {
    background: #fff;
    color: var(--red);
    border: 1px solid #f0c2c2;
}

.btn-danger:hover:not(:disabled) {
    background: #fdf3f3;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.back-button {
    border: none;
    background: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin-bottom: 18px;
}

.back-button:hover {
    color: var(--red);
}

/* ==========================================================
   搜索
   ========================================================== */

.search-box {
    position: relative;
    margin-bottom: 20px;
    max-width: 420px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: .5;
}

.search-box input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    background: #fff;
}

.search-box input:focus {
    border-color: var(--red);
}

/* ==========================================================
   卡片
   ========================================================== */

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    overflow: hidden;
    padding: 26px;
}

/* ==========================================================
   账号表格
   ========================================================== */

.table-wrap {
    overflow-x: auto;
}

.account-table {
    width: 100%;
    border-collapse: collapse;
}

.account-table th,
.account-table td {
    padding: 15px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f1f3;
    font-size: 14px;
    white-space: nowrap;
}

.account-table th {
    background: #fafbfc;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.account-table tbody tr {
    cursor: pointer;
    transition: background .12s;
}

.account-table tbody tr:hover {
    background: #fafbfc;
}

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

.username {
    font-weight: 600;
}

.steam-account {
    color: var(--muted);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px;
}

.rank {
    font-weight: 600;
}

.rp {
    font-weight: 600;
    color: var(--red);
}

.muted {
    color: #bbb;
}

.empty {
    text-align: center;
    padding: 70px 20px;
    color: #999;
}

.empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 16px;
    margin-bottom: 6px;
}

.empty-description {
    font-size: 13px;
    color: #aaa;
}

/* ==========================================================
   状态
   ========================================================== */

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    background: #eee;
    color: #777;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-online {
    background: #e7f7ee;
    color: #1a9c56;
}

.status-offline {
    background: #f0f1f3;
    color: #888;
}

.status-error {
    background: #fdeaea;
    color: var(--red);
}

.status-ingame {
    background: #fff4e5;
    color: #d98300;
}

/* ==========================================================
   弹窗
   ========================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .45);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-box {
    width: 480px;
    max-width: calc(100% - 30px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
}

.modal-title {
    margin: 0 0 22px;
    font-size: 20px;
}

.form-item {
    margin-bottom: 16px;
}

.form-item label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    color: #444;
}

.form-item input,
.form-item select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    background: #fff;
}

.form-item input:focus,
.form-item select:focus {
    border-color: var(--red);
}

.form-hint {
    margin-top: 5px;
    font-size: 12px;
    color: #999;
    line-height: 1.5;
}

.form-error {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fdeaea;
    color: #b32626;
    font-size: 13px;
}

.form-error.show {
    display: block;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

/* ==========================================================
   账号详情
   ========================================================== */

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.account-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.account-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #f0f1f3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    overflow: hidden;
    flex-shrink: 0;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.account-header-name {
    margin: 0 0 4px;
    font-size: 22px;
}

.account-header-account {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.section {
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--border);
}

.section:first-of-type {
    border-top: none;
}

.section-title {
    margin: 0 0 16px;
    font-size: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.info-item {
    min-width: 0;
}

.info-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.info-value {
    font-size: 15px;
    word-break: break-all;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.stat-card {
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 22px;
    font-weight: 600;
}

.password-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-value {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 15px;
    letter-spacing: 2px;
    word-break: break-all;
}

.password-toggle {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.password-toggle:hover {
    background: #f5f6f8;
}

.action-row {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* ==========================================================
   刷新提示
   ========================================================== */

.refresh-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fafbfc;
    border: 1px solid var(--border);
    font-size: 13px;
    color: #555;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.refresh-note.error {
    background: #fdeaea;
    border-color: #f6d4d4;
    color: #b32626;
}

/* ==========================================================
   登录页
   ========================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, #1b1d21 0%, #2b2f36 60%, #3a2022 100%);
}

.login-box {
    width: 400px;
    max-width: 100%;
    background: #fff;
    border-radius: 14px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.login-logo {
    text-align: center;
    font-size: 40px;
    margin-bottom: 10px;
}

.login-title {
    margin: 0 0 6px;
    text-align: center;
    font-size: 21px;
}

.login-subtitle {
    margin: 0 0 26px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.login-box .btn {
    width: 100%;
    height: 44px;
}

/* ==========================================================
   提示条
   ========================================================== */

.toast {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translate(-50%, -20px);
    padding: 12px 22px;
    border-radius: 8px;
    background: #1b1d21;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.success {
    background: #1a9c56;
}

.toast.error {
    background: var(--red);
}

/* ==========================================================
   加载
   ========================================================== */

.loading {
    padding: 50px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ==========================================================
   响应式
   ========================================================== */

@media (max-width: 900px) {
    .header {
        padding: 0 16px;
    }

    .container {
        margin: 20px auto;
    }

    .page-title {
        font-size: 22px;
    }

    .card {
        padding: 18px;
    }

    .account-table {
        min-width: 780px;
    }
}
