body {
    font-family: -apple-system, "PingFang SC", "Segoe UI", sans-serif;
    margin: 0;
    background: #f5f6f8;
    color: #1a1a1a;
}

.site-logo {
    position: fixed;
    top: 10px;
    left: 18px;
    z-index: 100;
    line-height: 0;
    background: #05070a;
    border-radius: 10px;
    padding: 5px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.site-logo img {
    height: 56px;
    width: auto;
    display: block;
    border-radius: 4px;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
    padding: 0 20px 0 140px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.topnav {
    display: flex;
    gap: 20px;
}

.topnav a {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.topnav a:hover {
    color: #555;
    text-decoration: underline;
}

.logout-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-form button {
    padding: 6px 14px;
    background: #eee;
    color: #1a1a1a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.logout-form button:hover {
    background: #ddd;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-switcher {
    display: flex;
    gap: 4px;
    font-size: 13px;
}

.lang-switcher a.lang-link {
    color: inherit;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.55;
}

.lang-switcher a.lang-link:hover {
    opacity: 0.85;
}

.lang-switcher a.lang-link.active {
    opacity: 1;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.06);
}

.lang-switcher-standalone {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    color: #fff;
}

.lang-switcher-standalone a.lang-link {
    color: #fff;
}

.lang-switcher-standalone a.lang-link.active {
    background: rgba(255, 255, 255, 0.18);
}

.promoter-lang-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}


.login-box {
    max-width: 400px;
    margin: 120px auto;
    padding: 32px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
    font-size: 20px;
    white-space: nowrap;
    margin: 0 0 24px;
}

.login-box label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
}

.login-box input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    margin-top: 4px;
}

.login-box button {
    width: 100%;
    padding: 10px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 登录页专属配色:整页背景改黑,原来黑色的logo底衬和登录按钮改绿。
   用 :has(.login-box) 限定只在登录页生效,不影响其它页面共用的同一份CSS。 */
body:has(.login-box) {
    background: #000;
}

body:has(.login-box) .site-logo {
    background: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

body:has(.login-box) .login-box button {
    background: #16a34a;
}

body:has(.login-box) .login-box button:hover {
    background: #128a3e;
}

.error {
    color: #c0392b;
}

.page {
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 24px 24px;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.card label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
}

.card label.inline {
    display: inline-block;
    margin-right: 12px;
}

.card input[type="text"],
.card textarea,
.card select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    margin-top: 4px;
    font-size: 14px;
}

.card button, .inline-form button {
    padding: 8px 16px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.card button.danger, .inline-form button.danger {
    background: #c0392b;
}

/* 原生 <input type="file"> 的"选取文件/未选择文件"文字由浏览器按操作系统
   语言渲染,不受这套i18n控制——中文系统的用户永远会看到中文按钮,不管UI
   语言切成什么。标准做法:隐藏原生input,自己做一个走request.state.t()的
   按钮+文件名显示区,点按钮用JS触发隐藏的原生input。 */
.file-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.file-input-native {
    display: none;
}

.file-input-button {
    padding: 8px 16px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

.file-input-name {
    color: #777;
    font-size: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th, table td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #eee;
}

.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #fdecea; color: #c0392b; }
.status-review { background: #fff8e1; color: #b8860b; }
.status-generated { background: #e3f2fd; color: #1565c0; }
.status-draft { background: #eee; color: #555; }
.status-published { background: #e8f5e9; color: #2e7d32; }
.status-failed { background: #fdecea; color: #c0392b; }
.status-scheduled { background: #e3f2fd; color: #1565c0; }
.status-executing { background: #fff8e1; color: #b8860b; }
.status-cancelled { background: #eee; color: #555; }
.status-active { background: #e8f5e9; color: #2e7d32; }
.status-paused { background: #fff8e1; color: #b8860b; }
.status-ended { background: #eee; color: #555; }
.status-pending { background: #fff8e1; color: #b8860b; }
.status-open { background: #fdecea; color: #c0392b; }
.status-resolved { background: #e8f5e9; color: #2e7d32; }

.flash-error {
    max-width: 900px;
    margin: 16px auto 0;
    padding: 12px 20px;
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6c0;
    border-radius: 6px;
    font-size: 14px;
}

.muted { color: #777; }
.small { font-size: 12px; }

.version-block {
    border-top: 1px solid #eee;
    padding-top: 12px;
    margin-top: 12px;
}

.inline-form {
    display: inline-flex;
    gap: 8px;
    margin-right: 8px;
    margin-top: 8px;
}

.inline-form input {
    padding: 6px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.home-tile {
    display: block;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a1a;
}

.home-tile:hover {
    border-color: #ccc;
    background: #f2f2f2;
}

.home-tile h2 {
    margin: 0 0 6px;
    font-size: 16px;
}
