* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif; background: #f3f5f7; color: #2b3238; font-size: 14px; }
a { text-decoration: none; color: inherit; }

.topnav { position: sticky; top: 0; z-index: 100; display: flex; align-items: stretch; background: #1f2a36; color: #cfd8e0; min-height: 52px; }
.brand { display: flex; align-items: center; padding: 0 18px; font-size: 16px; font-weight: 700; color: #fff; border-right: 1px solid rgba(255,255,255,.08); white-space: nowrap; }
.nav-toggle { display: none; background: none; border: none; color: #cfd8e0; font-size: 20px; padding: 0 14px; cursor: pointer; }
.nav { display: flex; align-items: stretch; flex: 1; min-width: 0; }
.nav-link { display: flex; align-items: center; padding: 0 16px; color: #cfd8e0; background: none; border: none; border-bottom: 3px solid transparent; font-size: 14px; font-family: inherit; cursor: pointer; white-space: nowrap; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active, .nav-dropdown.active > .nav-link { background: rgba(64,158,255,.15); color: #fff; border-bottom-color: #409eff; }
.caret { font-size: 10px; margin-left: 5px; }

.nav-dropdown { position: relative; display: flex; align-items: stretch; }
.nav-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 170px; background: #fff; border: 1px solid #e4e9ee; border-radius: 0 0 6px 6px; box-shadow: 0 6px 16px rgba(0,0,0,.12); padding: 6px 0; }
.nav-dropdown-right { left: auto; right: 0; }
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-item { display: block; width: 100%; padding: 9px 16px; color: #2b3238; font-size: 14px; text-align: left; white-space: nowrap; }
.nav-dropdown-item:hover { background: #f0f5fa; }
.nav-dropdown-item.active { color: #2273c4; font-weight: 600; background: #e8f2ff; }
.nav-dropdown-button { background: none; border: none; font-family: inherit; cursor: pointer; }
.nav-user { margin-left: auto; border-left: 1px solid rgba(255,255,255,.08); }
.nav-locale { display: flex; align-items: center; padding: 0 12px; margin-left: auto; }
.nav-locale-select { background: #2a3744; color: #cfd8e0; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; padding: 5px 8px; font-size: 13px; font-family: inherit; cursor: pointer; }
.nav-locale-select:focus { outline: none; border-color: #409eff; }

.content { padding: 20px; }
.card { background: #fff; border: 1px solid #e4e9ee; border-radius: 6px; padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 16px; margin-bottom: 14px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #edf1f4; vertical-align: top; }
.table th { width: 180px; color: #7a8794; font-weight: 600; background: #fafbfc; }
.table thead th { width: auto; background: #fafbfc; }

.badge { display: inline-block; padding: 3px 9px; margin: 2px 4px 2px 0; background: #e8f2ff; color: #2273c4; border-radius: 10px; font-size: 12px; }
.badge-secondary { background: #eef1f4; color: #5a6672; }
.badge-info { background: #e5f7ef; color: #1c8a56; }
.badge-warn { background: #fdf0e3; color: #b96a13; }
.text-muted { color: #9aa5af; }

.btn { display: inline-block; padding: 7px 16px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: 14px; background: #fff; }
.btn-primary { background: #2273c4; color: #fff; }
.btn-primary:hover { background: #1b5fa6; }
.btn-link { background: none; color: #2273c4; padding: 4px 6px; }
.btn-danger { background: #d9534f; color: #fff; }
.btn-block { width: 100%; }

.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; }
.alert-error { background: #fdecea; color: #a93226; border: 1px solid #f5c6c0; }
.alert-success { background: #e5f7ef; color: #1c8a56; border: 1px solid #b7e6cf; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; color: #4a5560; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 10px; border: 1px solid #d5dde5; border-radius: 4px; font-size: 14px; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.form-inline .form-group { margin-bottom: 0; min-width: 160px; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #1f2a36; }
.login-card { width: 360px; background: #fff; border-radius: 8px; padding: 32px 30px; }
.login-brand { font-size: 18px; text-align: center; margin-bottom: 6px; }
.login-title { font-size: 15px; text-align: center; color: #7a8794; margin-bottom: 22px; font-weight: 500; }
.login-locale-form .form-group { margin-bottom: 18px; }
.login-locale-form label { color: #7a8794; font-weight: 500; font-size: 13px; }

.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.error-card { text-align: center; }
.error-code { font-size: 64px; font-weight: 700; color: #2273c4; }
.error-message { margin: 12px 0 22px; color: #5a6672; }

.pagination { display: flex; gap: 6px; margin-top: 14px; align-items: center; }
.pagination button { padding: 5px 11px; border: 1px solid #d5dde5; background: #fff; border-radius: 4px; cursor: pointer; }
.pagination button[disabled] { opacity: .5; cursor: default; }
.pagination .page-info { color: #7a8794; }

@media (max-width: 768px) {
    .topnav { flex-wrap: wrap; }
    .nav-toggle { display: block; }
    .brand { border-right: none; padding: 14px 10px 14px 0; flex: 1; }
    .nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; order: 3; }
    .nav.open { display: flex; }
    .nav-link { padding: 12px 18px; border-bottom: none; border-left: 3px solid transparent; }
    .nav-link.active, .nav-dropdown.active > .nav-link { border-bottom: none; border-left-color: #409eff; }
    .nav-dropdown { flex-direction: column; }
    .nav-dropdown-menu { position: static; display: none; border: none; border-radius: 0; box-shadow: none; background: rgba(255,255,255,.04); padding: 0; }
    .nav-dropdown.open .nav-dropdown-menu, .nav-dropdown:hover .nav-dropdown-menu { display: block; }
    .nav-dropdown-item { color: #cfd8e0; padding: 10px 30px; }
    .nav-dropdown-item:hover { background: rgba(255,255,255,.06); }
    .nav-dropdown-item.active { color: #fff; background: rgba(64,158,255,.18); }
    .nav-user { margin-left: 0; border-left: none; border-top: 1px solid rgba(255,255,255,.08); flex-basis: 100%; order: 4; }
    .nav-user .nav-dropdown-menu { display: none; }
    .nav-user.open .nav-dropdown-menu { display: block; }
}
