/* ===== 基础重置 ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
    background: #f5f7fb;
    color: #333;
    line-height: 1.6;
}

/* ===== 顶部 ===== */
header {
    background: #1f2937;
    color: #fff;
    padding: 16px 20px;
}

header .header-inner {
    max-width: 1100px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header a {
    color: #93c5fd;
    text-decoration: none;
    margin-left: 16px;
}

/* ===== 主体 ===== */
main {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.card h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

/* ===== 表格 ===== */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background: #f9fafb;
    font-weight: 600;
}

/* ===== 表单 ===== */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row label {
    line-height: 1.2;
    flex: 1 0 180px;
}

.form-row input[type="text"] {
    flex: 2 0 240px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    max-width: 100%;
}

.form-row input[type="password"] {
    flex: 2 0 240px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    max-width: 100%;
}

.form-row input[type="submit"] {
    line-height: 1.2;
}

button,
input[type="submit"] {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
    background: #1d4ed8;
}

/* ===== 页脚 ===== */
footer {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 14px;
}

/* ===== 移动端 ===== */
@media (max-width: 768px) {
    header .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .form-row {
        flex-direction: column;
        gap: 6px;          
        margin-bottom: 6px;
    }
    
    .form-row label,
    .form-row input[type="text"] {
        flex: none;          /* 清掉 flex-basis */
        width: auto;
    }

    .form-row input[type="text"] {
        padding: 6px 8px;
    }

    .form-row input[type="submit"] {
        padding: 6px 14px;
    }
}

/* ===== 未登录居中页 ===== */
.gate {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5f7fb;
}

.gate-card {
    background: #fff;
    padding: 36px 32px;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    text-align: center;
    width: 100%;
    max-width: 360px;
}

.gate-card h1 {
    font-size: 22px;
    margin-bottom: 24px;
}

.gate-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gate-actions a {
    display: block;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
}

.gate-actions .login {
    background: #2563eb;
    color: #fff;
}

.gate-actions .register {
    background: #e5e7eb;
    color: #111827;
}

.gate-actions a:hover {
    opacity: 0.9;
}

.gate-card input[type="text"],
.gate-card input[type="password"] {
    padding: 12px 14px;      /* ↑ 关键：拉高输入框 */
    font-size: 15px;
    line-height: 1.2;
    border-radius: 8px;
}

.error-text {
    color: #ff4d4f;
    margin: 12px 0 20px;
    font-size: 14px;
    text-align: center;
}

.msg {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

.msg.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #10b981;
}

.msg.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.msgbox {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    z-index: 9999;
    animation: fadeOut 1s ease forwards;
    animation-delay: 1s;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
}