* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", Arial, sans-serif; color: #221819; background: #f4f1eb; }
button, input, select, textarea { font: inherit; }
button { border: 0; border-radius: 6px; padding: 10px 14px; cursor: pointer; background: #ccb88f; color: #261b1d; }
table { width: 100%; border-collapse: collapse; }
th, td { border-top: 1px solid #eee5d7; padding: 12px 10px; text-align: left; vertical-align: middle; }
th { color: #7b6b66; font-weight: 600; background: #fbf8f1; }
td small { display: block; color: #887d7d; margin-top: 4px; line-height: 1.6; }
td:last-child { width: 180px; text-align: right; }
td button { margin-left: 8px; padding: 7px 10px; }
input, select, textarea { width: 100%; border: 1px solid #d4c8b5; border-radius: 6px; padding: 10px; background: #fff; color: #261b1d; }
textarea { min-height: 92px; resize: vertical; }

.app { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; transition: grid-template-columns .2s ease; }
.app.hidden { display: none; }
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px; background: linear-gradient(rgba(5, 18, 24, .26), rgba(5, 18, 24, .42)), url("/4.jpg") center center / cover no-repeat; position: relative; overflow: hidden; }
.login-screen:after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1px); background-size: 3px 3px; opacity: .55; }
.login-screen.hidden { display: none; }
.login-card { width: 400px; background: rgba(25, 31, 43, .86); border: 0; border-radius: 4px; padding: 38px 40px 34px; box-shadow: 0 22px 54px rgba(0,0,0,.34); position: relative; z-index: 1; }
.login-title { text-align: center; margin-bottom: 30px; color: #10a7ac; }
.login-card h1 { margin: 0; font-size: 25px; font-weight: 500; color: #11aab0; }
.login-card p { margin: 2px 0 0; color: #11aab0; font-size: 20px; }
.login-field { height: 42px; margin-bottom: 15px; display: flex; align-items: center; background: #fff; border-radius: 4px; overflow: hidden; }
.login-icon { width: 48px; height: 42px; position: relative; flex: 0 0 48px; color: #273244; }
.icon-user:before { content: ""; position: absolute; left: 18px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.icon-user:after { content: ""; position: absolute; left: 14px; top: 23px; width: 20px; height: 10px; border-radius: 10px 10px 3px 3px; background: currentColor; }
.svg-icon { display: flex; align-items: center; justify-content: center; }
.svg-icon svg { width: 24px; height: 24px; fill: currentColor; display: block; }
.login-field input { border: 0; padding: 0 10px; height: 42px; margin: 0; color: #333; }
.captcha-field input { flex: 1; min-width: 0; }
.captcha-field canvas { width: 126px; height: 42px; cursor: pointer; border-left: 1px solid #e2e2e2; }
.login-submit { width: 100%; height: 42px; border-radius: 0; background: #0b9a8f; color: #fff; font-size: 16px; margin-top: 5px; }
.login-submit:hover { background: #0aa89b; }
.login-message { min-height: 22px; margin-top: 12px; color: #f4b2b2; font-size: 14px; text-align: center; }
.app.sidebar-collapsed { grid-template-columns: 72px 1fr; }
aside { background: #8f3232; color: #fff; padding: 22px 16px; overflow-y: auto; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
aside h1 { margin: 0; font-size: 26px; white-space: nowrap; }
.icon-button { width: 34px; height: 34px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; }
.sidebar-collapsed .icon-button { transform: rotate(180deg); }
nav { margin-top: 24px; display: grid; gap: 4px; }
nav button { width: 100%; min-height: 40px; text-align: left; background: transparent; color: #f8e8e8; border-radius: 0; display: flex; align-items: center; gap: 10px; padding: 9px 8px; }
nav button:hover, nav button.active { color: #fff; background: rgba(255,255,255,.08); }
nav button.active { font-weight: 700; border-left: 3px solid #ebcf97; padding-left: 5px; }
.nav-group { border-top: 1px solid rgba(255,255,255,.15); padding-top: 6px; margin-top: 6px; }
.nav-title { justify-content: space-between; font-weight: 600; }
.nav-title .nav-text { flex: 1; }
.nav-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; border: 1px solid rgba(255,255,255,.28); color: #fff; font-size: 14px; }
.app:not(.sidebar-collapsed) nav > button .nav-icon,
.app:not(.sidebar-collapsed) .nav-title .nav-icon { display: none; }
.chevron { transition: transform .18s ease; opacity: .75; }
.nav-group.expanded .chevron { transform: rotate(90deg); }
.nav-children { display: none; padding: 2px 0 4px 38px; }
.nav-group.expanded .nav-children { display: grid; gap: 2px; }
.sub-link { min-height: 34px; font-size: 14px; color: #f1d6d6; }
.sub-link .nav-icon { display: none; }

.sidebar-collapsed aside { padding: 18px 10px; overflow: visible; }
.sidebar-collapsed aside h1, .sidebar-collapsed .nav-text, .sidebar-collapsed .chevron { display: none; }
.sidebar-collapsed .brand-row { justify-content: center; }
.sidebar-collapsed nav { gap: 8px; }
.sidebar-collapsed nav button { justify-content: center; padding: 8px; min-height: 44px; }
.sidebar-collapsed nav button.active { border-left: 0; border-bottom: 2px solid #ebcf97; padding-left: 8px; }
.sidebar-collapsed .nav-group { border-top: 0; margin-top: 0; padding-top: 0; position: relative; }
.sidebar-collapsed .nav-children { display: none; position: absolute; left: 54px; top: 0; min-width: 132px; padding: 8px 10px; background: #8f3232; box-shadow: 0 10px 28px rgba(0,0,0,.18); z-index: 20; }
.sidebar-collapsed .nav-group:hover .nav-children { display: grid; }
.sidebar-collapsed .sub-link { justify-content: flex-start; color: #fff; white-space: nowrap; }
.sidebar-collapsed .sub-link .nav-icon { display: none; }
.sidebar-collapsed .sub-link .nav-text { display: inline; }

main { padding: 28px; min-width: 0; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
header p { margin: 0; color: #8a7772; }
header h2 { margin: 2px 0 0; font-size: 30px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.user-menu { position: relative; }
.user-button { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: #8f3232; color: #fff; font-weight: 700; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 136px; background: #fff; border: 1px solid #ded4c1; box-shadow: 0 12px 28px rgba(0,0,0,.12); z-index: 50; padding: 6px; }
.user-dropdown button { width: 100%; text-align: left; background: transparent; color: #261b1d; border-radius: 0; }
.user-dropdown button:hover { background: #fbf8f1; }
.message { min-height: 24px; margin-bottom: 14px; color: #8f3232; }
.panel { background: #fff; border: 1px solid #ded4c1; border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.panel h3 { margin: 0; font-size: 20px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fbf8f1; border: 1px solid #eee5d7; padding: 18px; }
.stat strong { display: block; font-size: 34px; color: #8f3232; line-height: 1; }
.stat span { display: block; margin-top: 8px; color: #7b6b66; }
.placeholder { background: #fbf8f1; border: 1px dashed #d4c8b5; padding: 28px; color: #7b6b66; }
.placeholder strong { display: block; color: #261b1d; font-size: 20px; margin-bottom: 8px; }
.placeholder p { margin: 0; line-height: 1.8; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.danger { background: #b94a48; color: #fff; }
.secondary { background: #eee5d7; color: #5a4b46; }
.hidden { display: none; }
.empty { text-align: center; color: #887d7d; padding: 28px; }
.editor-wrap { grid-column: 1 / -1; border: 1px solid #d4c8b5; border-radius: 8px; overflow: hidden; background: #fff; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-bottom: 1px solid #eee5d7; background: #fbf8f1; }
.toolbar button, .upload { border-radius: 6px; padding: 8px 12px; background: #eee5d7; color: #261b1d; cursor: pointer; }
.upload input { display: none; }
.cover-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.cover-upload { display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.editor { min-height: 280px; padding: 16px; line-height: 1.9; outline: none; }
.editor.tall { min-height: 460px; }
.editor img { display: block; max-width: 100%; margin: 14px auto; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.permission-checks { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; padding: 12px; border: 1px solid #eee5d7; background: #fbf8f1; }
.permission-checks h4 { grid-column: 1 / -1; margin: 10px 0 0; color: #7b6b66; font-size: 14px; }
.permission-checks h4:first-child { margin-top: 0; }
.permission-checks label { min-height: 28px; display: flex; align-items: center; gap: 8px; }
.permission-checks input { width: auto; }

@media (max-width: 960px) {
  .app, .app.sidebar-collapsed { grid-template-columns: 1fr; }
  .grid, .grid.compact, .permission-checks { grid-template-columns: 1fr; }
  td:last-child { width: auto; }
}
