:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --muted: #6b7280;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.container {
    max-width: 960px;
    margin: 40px auto;
    padding: 0 20px 60px;
}

.container.narrow {
    max-width: 520px;
}

h1 { font-size: 26px; margin-bottom: 8px; }
h2 { font-size: 18px; margin: 28px 0 12px; }

.hint {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-card p { margin: 4px 0; }

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    font-family: inherit;
}

textarea {
    resize: vertical;
}

.domain-input-group {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.domain-input-group input[type="text"] {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.domain-input-group select {
    border-radius: 0 8px 8px 0;
    width: auto;
    flex-shrink: 0;
    max-width: 45%;
    background: #f9fafb;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

button:hover { background: var(--primary-dark); }

.btn-secondary {
    background: var(--muted);
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    margin-top: 0;
}

.btn-danger { background: var(--danger); }

.inline-form {
    display: inline-block;
    margin: 0 0 16px 0;
}

.actions {
    display: flex;
    gap: 6px;
}

.actions form { margin: 0; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-muted { background: #f3f4f6; color: #6b7280; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    font-size: 13px;
}

.data-table th, .data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--muted);
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 24px;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
}

.stat-value { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.admin-body { background: var(--bg); }

.admin-nav {
    background: #111827;
    color: white;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand { font-weight: 700; }

.nav-links a {
    color: #d1d5db;
    text-decoration: none;
    margin-left: 18px;
    font-size: 14px;
}

.nav-links a:hover { color: white; }

.login-box {
    max-width: 360px;
    margin: 120px auto;
    background: var(--card-bg);
    padding: 32px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

details summary {
    cursor: pointer;
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

.action-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
    min-width: 220px;
}

.action-panel .inline-form {
    display: flex;
    gap: 6px;
    margin: 0;
}

.mini-input {
    width: auto;
    flex: 1;
    padding: 6px 8px;
    font-size: 12px;
}
