* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f4f5f7;
    color: #1d1d1f;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }

.stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    flex: 1;
    font-size: 13px;
    color: #666;
}
.stat-card strong { font-size: 20px; color: #1d1d1f; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 13px;
    color: #555;
    margin: 10px 0 4px;
}
input[type=text], input[type=password], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d8d8dc;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
input[type=file] { margin-top: 4px; }

.actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.export-actions a { font-size: 13px; }

button, .btn-secondary, .btn-danger {
    display: inline-block;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}
button[type=submit], button:not(.link-danger) {
    background: #0071e3;
    color: #fff;
}
button[type=submit]:hover { background: #0066cc; }
.btn-secondary {
    background: #eef0f2;
    color: #1d1d1f;
}
.btn-secondary:hover { background: #e2e4e7; }
.btn-danger { background: #ff3b30; color: #fff; }
.btn-danger:hover { background: #e0342a; }

.link-danger {
    background: none;
    border: none;
    color: #ff3b30;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
}

.hint { font-size: 12px; color: #888; margin: 0 0 8px; }
.hint code { background: #f0f0f2; padding: 1px 4px; border-radius: 4px; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th, td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.empty { text-align: center; color: #999; padding: 24px 0; }
.row-actions a { margin-right: 10px; color: #0071e3; text-decoration: none; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
}
.badge-ios { background: #e5f1ff; color: #0071e3; }
.badge-mac { background: #eee5ff; color: #7b3fe4; }

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}
.alert-success { background: #e6f9ee; color: #1f9254; }
.alert-error { background: #fdecea; color: #d93025; }

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}
.login-box {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    width: 320px;
}
.login-box h1 { text-align: center; margin-bottom: 20px; font-size: 18px; }
.login-box button { width: 100%; margin-top: 16px; padding: 10px; }
