/* ===================================================
   卡密验证小网站 - 全局样式
   白色卡片简约风格，无 emoji，区域线框清晰
   =================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: #f5f6f8;
    color: #1f2329;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #2b5cff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.page-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

/* ============ 卡片容器 ============ */
.main-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    padding: 32px 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* ============ 品牌区 ============ */
.brand-area {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f1f3;
    margin-bottom: 24px;
}

.brand-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2329;
    letter-spacing: 0.5px;
}

.brand-sub {
    margin-top: 6px;
    font-size: 13px;
    color: #86909c;
}

/* ============ 项目说明 ============ */
.project-desc {
    background: #f7f8fa;
    border: 1px solid #eef0f2;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 16px;
    color: #4e5969;
    font-size: 13px;
    line-height: 1.7;
}

/* ============ 警告/提示框 ============ */
.warning-box {
    background: #fff7e8;
    border: 1px solid #ffd773;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 20px;
    color: #9c6b00;
    font-size: 13px;
    line-height: 1.7;
}

.warning-box strong {
    color: #c2410c;
}

.warning-box-danger {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 20px;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.7;
}

.warning-box-danger strong {
    color: #991b1b;
}

.success-box {
    background: #f0fbf3;
    border: 1px solid #b7eb8f;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    color: #1d6e3f;
    font-size: 14px;
    line-height: 1.8;
}

/* ============ 表单区 ============ */
.form-area {
    margin-bottom: 20px;
}

.field-row {
    margin-bottom: 16px;
}

.field-label {
    display: block;
    font-size: 13px;
    color: #4e5969;
    margin-bottom: 6px;
    font-weight: 500;
}

.field-input {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #cdd2d8;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2329;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field-input:focus {
    outline: none;
    border-color: #2b5cff;
    box-shadow: 0 0 0 3px rgba(43, 92, 255, 0.12);
}

.field-input::placeholder {
    color: #b3b8c0;
}

.form-tip {
    margin-top: 8px;
    font-size: 12px;
    color: #86909c;
    line-height: 1.6;
}

/* ============ 按钮 ============ */
.btn-primary {
    width: 100%;
    height: 40px;
    margin-top: 14px;
    background: #2b5cff;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:hover:not(:disabled) {
    background: #1f4ad6;
}

.btn-primary:disabled {
    background: #b3c4ff;
    cursor: not-allowed;
}

/* ============ 消息框 ============ */
.msg-box {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
}

.msg-error {
    background: #ffece8;
    border: 1px solid #ffb8a8;
    color: #c0331d;
}

.msg-success {
    background: #f0fbf3;
    border: 1px solid #b7eb8f;
    color: #1d6e3f;
}

/* ============ 联系区 ============ */
.contact-area {
    border-top: 1px solid #f0f1f3;
    padding-top: 16px;
    text-align: center;
}

.contact-line {
    font-size: 13px;
    color: #4e5969;
}

.contact-line strong {
    color: #1f2329;
}

/* ============ 页脚 ============ */
.page-footer {
    margin-top: 20px;
    font-size: 12px;
    color: #b3b8c0;
}

.link {
    color: #2b5cff;
}

/* ===================================================
   首页多卡密模式 + 批量验证结果
   =================================================== */

/* 模式切换 tab */
.mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f0f1f3;
    padding-bottom: 8px;
}

.mode-tab {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    border: 1px solid #cdd2d8;
    border-radius: 6px;
    background: #ffffff;
    color: #4e5969;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.mode-tab:hover {
    border-color: #2b5cff;
    color: #2b5cff;
    text-decoration: none;
}

.mode-tab.active {
    background: #2b5cff;
    border-color: #2b5cff;
    color: #ffffff;
    font-weight: 500;
}

/* textarea */
.field-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cdd2d8;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2329;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', 'Microsoft YaHei', monospace;
    line-height: 1.7;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field-textarea:focus {
    outline: none;
    border-color: #2b5cff;
    box-shadow: 0 0 0 3px rgba(43, 92, 255, 0.12);
}

.field-textarea::placeholder {
    color: #b3b8c0;
    font-family: 'Microsoft YaHei', sans-serif;
}

/* 批量验证结果 */
.batch-result {
    margin-top: 20px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    background: #f7f8fa;
    padding: 16px;
}

.batch-result-summary {
    font-size: 13px;
    color: #1f2329;
    line-height: 1.8;
    margin-bottom: 12px;
}

.batch-result-list {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid #eef0f2;
    border-radius: 4px;
    background: #ffffff;
    margin-bottom: 12px;
}

.batch-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f1f3;
    font-size: 13px;
}

.batch-item:last-child {
    border-bottom: none;
}

.batch-item-idx {
    display: inline-block;
    min-width: 24px;
    text-align: right;
    color: #86909c;
    font-size: 12px;
}

.batch-item-code {
    flex: 1;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #1f2329;
    word-break: break-all;
}

.batch-item-status {
    font-size: 12px;
    white-space: nowrap;
}

.item-valid {
    background: #ffffff;
}

.item-valid .batch-item-status {
    color: #1d6e3f;
}

.item-invalid {
    background: #fff7f5;
}

.item-invalid .batch-item-status {
    color: #c0331d;
}

.batch-result-actions {
    display: flex;
    gap: 8px;
}

.batch-result-actions .btn-primary {
    flex: 1;
    margin-top: 0;
}

/* badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 500;
}

.badge-success {
    background: #e8ffea;
    color: #1d6e3f;
}

.badge-error {
    background: #ffece8;
    color: #c0331d;
}

/* ===================================================
   批量提交页（/b/{token}）
   =================================================== */

.batch-page .batch-card {
    max-width: 720px;
}

.batch-count-bar {
    background: #f7f8fa;
    border: 1px solid #eef0f2;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #4e5969;
    margin-bottom: 16px;
}

.batch-count-bar strong {
    color: #2b5cff;
    font-size: 14px;
    margin: 0 2px;
}

.batch-count-divider {
    color: #d0d4da;
    margin: 0 6px;
}

.account-type-hint {
    background: #fff7e8;
    border-color: #ffd773;
    color: #9c6b00;
}

.account-type-hint strong {
    color: #c2410c;
}

.batch-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-row {
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    background: #ffffff;
    padding: 12px 14px;
    transition: border-color 0.15s, background 0.15s;
}

.batch-row.row-has-error {
    border-color: #ffb8a8;
    background: #fff7f5;
}

.batch-row.row-done {
    border-color: #b7eb8f;
    background: #f0fbf3;
}

.batch-row-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #f0f1f3;
}

.batch-row-idx {
    display: inline-block;
    min-width: 28px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: #2b5cff;
    color: #ffffff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.batch-row-code {
    flex: 1;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #1f2329;
    font-size: 13px;
    word-break: break-all;
}

.batch-row-status {
    font-size: 14px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.batch-row-status.status-success {
    color: #1d6e3f;
}

.batch-row-status.status-error {
    color: #c0331d;
}

.batch-row-body {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.batch-field {
    flex: 1;
    min-width: 200px;
}

.batch-field label {
    display: block;
    font-size: 12px;
    color: #4e5969;
    margin-bottom: 4px;
}

.batch-row-msg {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
}

.batch-row-msg.row-error {
    background: #ffece8;
    color: #c0331d;
}

.batch-row-msg.row-success {
    background: #e8ffea;
    color: #1d6e3f;
}

@media (max-width: 600px) {
    .batch-page .batch-card {
        padding: 16px 12px;
    }
    .batch-row {
        padding: 10px;
    }
    .batch-row-body {
        flex-direction: column;
        gap: 8px;
    }
    .batch-field {
        min-width: 0;
    }
    .mode-tabs {
        flex-direction: column;
    }
}

/* ===================================================
   后台样式
   =================================================== */
.admin-wrap {
    min-height: 100vh;
    background: #f5f6f8;
    padding: 0;
}

.admin-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e6eb;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header h1 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2329;
}

.admin-header .nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

.admin-header .nav a {
    color: #4e5969;
    font-size: 13px;
}

.admin-header .nav a:hover,
.admin-header .nav a.active {
    color: #2b5cff;
    text-decoration: none;
}

.admin-body {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
}

.admin-section {
    background: #ffffff;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.admin-section h2 {
    font-size: 15px;
    color: #1f2329;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f1f3;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f1f3;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: #f7f8fa;
    color: #4e5969;
    font-weight: 500;
}

.admin-table tr:hover td {
    background: #fafbfc;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
}

.tag-unused {
    background: #e8f3ff;
    color: #2b5cff;
}

.tag-used {
    background: #f2f3f5;
    color: #86909c;
}

.tag-active {
    background: #e8ffea;
    color: #1d6e3f;
}

.tag-inactive {
    background: #fff0f0;
    color: #c0331d;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #cdd2d8;
    border-radius: 4px;
    color: #4e5969;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    border-color: #2b5cff;
    color: #2b5cff;
    text-decoration: none;
}

.btn-primary-sm {
    background: #2b5cff;
    border-color: #2b5cff;
    color: #ffffff;
}

.btn-primary-sm:hover {
    background: #1f4ad6;
    border-color: #1f4ad6;
    color: #ffffff;
}

.btn-danger {
    color: #c0331d;
    border-color: #ffb8a8;
}

.btn-danger:hover {
    background: #ffece8;
    border-color: #c0331d;
    color: #c0331d;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: end;
}

.form-row .field {
    flex: 1;
    min-width: 160px;
}

.form-row label {
    display: block;
    font-size: 12px;
    color: #4e5969;
    margin-bottom: 4px;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    height: 36px;
    padding: 6px 10px;
    border: 1px solid #cdd2d8;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.form-row textarea {
    height: auto;
    min-height: 60px;
    resize: vertical;
}

.form-row .actions {
    display: flex;
    gap: 8px;
}

/* 后台登录页 */
.login-card {
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    padding: 28px 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 16px;
    color: #1f2329;
}

/* 卡密批量展示框 */
.code-box {
    background: #f7f8fa;
    border: 1px solid #eef0f2;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #1f2329;
}

.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stat-card {
    background: #f7f8fa;
    border: 1px solid #eef0f2;
    border-radius: 6px;
    padding: 12px 16px;
    min-width: 120px;
}

.stat-card .num {
    font-size: 22px;
    font-weight: 600;
    color: #1f2329;
    line-height: 1.2;
}

.stat-card .label {
    font-size: 12px;
    color: #86909c;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .main-card {
        padding: 24px 18px;
    }
    .admin-body {
        padding: 0 8px;
    }
    .admin-section {
        padding: 14px;
    }
    .admin-table {
        font-size: 12px;
    }
    .admin-table th,
    .admin-table td {
        padding: 6px 4px;
    }
}
