:root{
  --ink:#17251f;
  --muted:#68756f;
  --line:#dce4df;
  --paper:#f5f7f4;
  --card:#ffffff;
  --green:#173f34;
  --green-2:#225848;
  --gold:#d7a948;
  --soft:#e9f0ec;
  --danger:#ad3f39;
  font-family:"Noto Sans TC","Microsoft JhengHei",system-ui,sans-serif;
  color:var(--ink);
  background:var(--paper);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%}
button,input{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
.center-view{min-height:100vh;display:grid;place-content:center;justify-items:center;gap:14px;background:var(--paper);color:var(--muted)}
.loader{width:38px;height:38px;border:4px solid #d9e3dd;border-top-color:var(--green);border-radius:50%;animation:spin .75s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.login-view{height:100vh;display:grid;grid-template-columns:minmax(440px,1.05fr) minmax(440px,.95fr);overflow:hidden}
.brand-panel{position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:center;padding:clamp(52px,8vw,120px);color:#fff;background:linear-gradient(145deg,#102b24,#1e4d40 62%,#15362d)}
.brand-panel:before,.brand-panel:after{content:"";position:absolute;border:1px solid #ffffff24;border-radius:50%}
.brand-panel:before{width:540px;height:540px;right:-300px;top:-210px}
.brand-panel:after{width:360px;height:360px;left:-220px;bottom:-190px}
.brand-copy,.brand-foot{position:relative;z-index:1}
.eyebrow{margin:0 0 18px;font-size:12px;font-weight:800;letter-spacing:.22em;color:#d8bd7a}
.eyebrow.dark{color:var(--green-2)}
.brand-copy h1{max-width:690px;margin:0;font-family:"Noto Serif TC","PMingLiU",serif;font-size:clamp(44px,5.2vw,76px);line-height:1.25;letter-spacing:.02em}
.brand-copy>p:last-child{max-width:580px;margin:28px 0 0;color:#d8e3df;font-size:17px;line-height:1.9}
.brand-foot{position:absolute;left:clamp(52px,8vw,120px);bottom:42px;color:#c8d5d0;font-weight:700;letter-spacing:.16em}
.login-panel{display:grid;place-items:center;padding:48px;background:#f8f6f0}
.login-card{width:min(430px,100%);padding:42px;border:1px solid #e3dfd3;border-radius:24px;background:#fff;box-shadow:0 26px 70px #24362f18}
.login-card h2{margin:0;font-size:32px}
.intro{margin:10px 0 30px;color:var(--muted)}
.login-card label{display:block;margin:18px 0 8px;font-size:14px;font-weight:800}
.login-card input{width:100%;height:50px;border:1px solid #cfd9d3;border-radius:10px;padding:0 14px;color:var(--ink);background:#fff;outline:none;transition:.2s}
.login-card input:focus{border-color:var(--green-2);box-shadow:0 0 0 4px #22584816}
.password-field{position:relative}
.password-field input{padding-right:64px}
.password-field button{position:absolute;right:8px;top:7px;height:36px;border:0;background:transparent;color:var(--green-2);font-size:13px;font-weight:800}
.primary-button{width:100%;height:50px;margin-top:26px;border:0;border-radius:10px;color:#fff;background:var(--green);font-weight:800;transition:.2s}
.primary-button:hover{background:var(--green-2)}
.primary-button:disabled{opacity:.65;cursor:wait}
.form-message{min-height:22px;margin:14px 0 0;text-align:center;color:var(--danger);font-size:14px}
.login-switch{display:block;margin-top:14px;text-align:center;color:var(--green-2);font-size:13px;font-weight:700}
.app-view{min-height:100vh;background:var(--paper)}
.topbar{height:76px;display:flex;align-items:center;padding:0 28px;border-bottom:1px solid #d9e2dc;background:#fffdf8;color:var(--ink);box-shadow:0 5px 20px #173f3409}
.wordmark{display:flex;align-items:center;gap:12px}
.wordmark strong,.wordmark small{display:block}.wordmark strong{font-size:17px}.wordmark small{margin-top:3px;color:var(--muted);font-size:11px}
.top-actions{margin-left:auto;display:flex;align-items:center;gap:10px}.top-user{margin-right:6px;color:#52635b;font-size:14px}
.outline-button{height:40px;padding:0 15px;border:1px solid #cfd9d3;border-radius:9px;background:#fff;color:var(--ink);font-weight:700}
.outline-button:hover{background:var(--soft)}
.app-shell{display:grid;grid-template-columns:245px 1fr;min-height:calc(100vh - 76px)}
.sidebar{display:flex;flex-direction:column;padding:24px 18px;border-right:1px solid #31574b;background:linear-gradient(180deg,#173f34 0%,#12342b 100%);color:#fff;box-shadow:10px 0 30px #173f3410}
.user-card{display:flex;align-items:center;gap:12px;padding:14px;border-radius:14px;background:#ffffff14}
.user-card strong,.user-card small{display:block}.user-card small{margin-top:3px;color:#c7d8d1;font-size:12px}
.nav-list{display:grid;gap:5px;margin-top:22px}
.nav-list button{position:relative;width:100%;height:46px;display:flex;align-items:center;gap:10px;border:0;border-radius:10px;padding:0 11px;background:transparent;color:#dce7e2;text-align:left;font-weight:700}
.nav-list button:hover{background:#ffffff12}.nav-list button.active{background:#fffaf0;color:var(--green);box-shadow:0 8px 22px #081d1735}.nav-list button.active:before{content:"";width:4px;height:22px;margin-right:1px;border-radius:999px;background:var(--gold)}
.nav-list button:disabled{cursor:default;opacity:.58}.nav-list em{margin-left:auto;font-size:10px;font-style:normal;color:#849088}
.sidebar-note{margin-top:auto;padding:14px;color:#b9cec5;font-size:12px;line-height:1.7}.sidebar-note span{color:#fff}
.main-content{width:100%;max-width:1500px;margin:0 auto;padding:34px 38px 54px}
.page-heading{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:25px}
.page-heading .eyebrow{margin-bottom:7px}.page-heading h2{margin:0;font-size:30px}.page-heading p:last-child{margin:8px 0 0;color:var(--muted)}
.environment-pill{padding:8px 13px;border:1px solid #bfd2c7;border-radius:999px;background:#edf5f0;color:var(--green-2);font-size:12px;font-weight:800}
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}
.stat-card,.content-card{border:1px solid var(--line);border-radius:16px;background:var(--card);box-shadow:0 8px 28px #253b3210}
.stat-card{padding:19px 20px}.stat-card span,.stat-card small{display:block;color:var(--muted);font-size:12px}.stat-card strong{display:block;margin:8px 0 5px;font-size:30px}
.content-card{margin-top:18px;padding:24px}
.section-heading{display:flex;align-items:center;justify-content:space-between}.section-heading h3{margin:0;font-size:20px}.section-heading p{margin:6px 0 0;color:var(--muted);font-size:13px}
.status-dot{color:var(--green-2);font-size:12px;font-weight:800}.status-dot:before{content:"";display:inline-block;width:8px;height:8px;margin-right:7px;border-radius:50%;background:#2a9c6b}
.module-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:20px}
.module-card{min-height:132px;padding:16px;border:1px solid var(--line);border-radius:13px;background:#fbfcfb}.module-card h4{margin:0 0 8px;font-size:16px}.module-card p{margin:0;color:var(--muted);font-size:12px;line-height:1.6}.module-card footer{margin-top:14px;color:#8b968f;font-size:11px;font-weight:700}
.dashboard-projects{margin-top:18px}.dashboard-heading{padding:22px 24px;border-bottom:1px solid var(--line)}.dashboard-modules{display:flex;flex-wrap:wrap;gap:7px;white-space:normal}.dashboard-module{display:inline-grid;gap:2px;padding:7px 10px;border-radius:10px;background:var(--soft);color:var(--green-2)}.dashboard-module strong{font-size:12px}.dashboard-module small{color:var(--muted);font-size:10px}.module-health{color:#27825d}
.primary-action{height:44px;padding:0 18px;border:0;border-radius:10px;background:var(--green);color:#fff;font-weight:800}
.primary-action:hover{background:var(--green-2)}
.table-card{padding:0;overflow:hidden}.table-wrap{width:100%;overflow:auto}
table{width:100%;border-collapse:collapse;white-space:nowrap}th,td{padding:16px 18px;border-bottom:1px solid var(--line);text-align:left;font-size:14px}th{background:#f7f9f7;color:var(--muted);font-size:12px}tbody tr:last-child td{border-bottom:0}.empty{padding:52px;text-align:center;color:var(--muted)}
.table-sub{display:block;margin-top:4px;color:var(--muted);font-size:11px;font-weight:500}.initial-password{display:flex;align-items:center;gap:7px}.initial-password code{padding:5px 7px;border-radius:6px;background:var(--soft);color:var(--ink);font-size:12px}.initial-password button{height:28px;border:1px solid #ccd7d1;border-radius:7px;background:#fff;color:var(--green);font-size:11px;font-weight:800}.hidden-field{visibility:hidden;pointer-events:none}
.module-tags{display:flex;flex-wrap:wrap;gap:6px;white-space:normal}.module-tag{display:inline-flex;padding:5px 8px;border-radius:999px;background:#e8f1ec;color:var(--green-2);font-size:11px;font-weight:800}.no-modules{color:var(--muted);font-size:12px}.authorization-summary{margin-bottom:17px;padding:15px 17px;border-radius:12px;background:var(--soft)}.authorization-summary span{display:block;color:var(--muted);font-size:11px}.authorization-summary strong{display:block;margin-top:4px}.authorization-summary p{margin:8px 0 0;color:var(--muted);font-size:12px}.module-checklist{display:grid;grid-template-columns:1fr 1fr;gap:10px}.module-option{padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff}.module-option:has([data-module-id]:checked){border-color:#7da28f;background:#f0f6f2}.module-option>label{display:flex;align-items:flex-start;gap:10px;cursor:pointer}.module-option [data-module-id]{width:18px!important;height:18px!important;margin-top:2px}.module-option span{display:block}.module-option strong,.module-option small{display:block}.module-option small{margin-top:5px;line-height:1.45}.module-dates{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:13px;padding-top:12px;border-top:1px solid var(--line)}.module-dates label{display:grid;gap:5px;color:var(--muted);font-size:11px;font-weight:700}.module-dates input{width:100%;height:38px;border:1px solid #ccd7d1;border-radius:8px;padding:0 8px;background:#fff}.module-dates input:disabled{background:#eef1ef;color:#9aa39e}.section-title{margin:30px 0 10px}.section-title h3{margin:0;font-size:22px}.section-title p{margin:6px 0 0;color:var(--muted);font-size:13px}.notice-card{margin-top:18px;padding:18px 20px;border:1px solid #ead7a8;border-radius:14px;background:#fff8e8}.notice-card p{margin:7px 0 0;color:#6e6247;line-height:1.65}.discount-table{max-width:620px}
.endpoint-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px 18px;margin-top:20px}.endpoint-grid label{display:grid;gap:7px;color:#3f4e47;font-size:13px;font-weight:800}.endpoint-grid input{width:100%;height:46px;border:1px solid #ccd7d1;border-radius:9px;padding:0 12px;outline:none}.endpoint-grid input:focus{border-color:var(--green-2);box-shadow:0 0 0 4px #22584812}.endpoint-save{margin-top:17px}.endpoint-note{margin:10px 0 0;color:var(--muted);font-size:12px}
.tag{display:inline-flex;padding:5px 9px;border-radius:999px;background:#edf3ef;color:var(--green-2);font-size:12px;font-weight:800}.tag.inactive,.tag.closed{background:#f0f1f0;color:#737b77}.tag.preparing{background:#fff4d8;color:#8b6717}
.row-actions{display:flex;gap:7px}.row-actions button{height:34px;padding:0 11px;border:1px solid #ccd7d1;border-radius:8px;background:#fff;color:var(--green);font-weight:800}.row-actions .delete{border-color:#e7cac7;color:var(--danger)}
.modal{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:24px;background:#10251e99;backdrop-filter:blur(3px)}
.modal-card{width:min(860px,100%);max-height:92vh;overflow:auto;border-radius:20px;background:#fff;box-shadow:0 30px 90px #071b1550}
.modal-card>header{position:sticky;top:0;z-index:2;display:flex;align-items:center;padding:20px 24px;border-bottom:1px solid var(--line);background:#fff}.modal-card h2{margin:0;font-size:22px}.modal-card>header button{margin-left:auto;width:36px;height:36px;border:0;border-radius:9px;background:var(--soft);color:var(--ink);font-size:24px}
#modalBody{padding:24px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px 18px}.form-grid label{display:grid;gap:7px;color:#3f4e47;font-size:13px;font-weight:800}.form-grid input,.form-grid select,.form-grid textarea{width:100%;min-width:0;height:46px;border:1px solid #ccd7d1;border-radius:9px;padding:0 12px;background:#fff;color:var(--ink);outline:none}.form-grid textarea{height:84px;padding-top:11px;resize:vertical}.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus{border-color:var(--green-2);box-shadow:0 0 0 4px #22584812}.form-grid small{color:var(--muted);font-weight:500}.wide{grid-column:1/-1}.check-field{display:flex!important;align-items:center;align-self:end;height:46px}.check-field input{width:18px;height:18px}.color-field{grid-template-columns:1fr 48px;align-items:end}.color-field input:first-of-type{grid-column:1}.color-field input[type=color]{grid-column:2;width:48px;padding:4px}.form-section{margin:24px 0 16px;padding-top:22px;border-top:1px solid var(--line)}.form-section h3{margin:0}.form-section p{margin:6px 0 0;color:var(--muted);font-size:13px}.asset-field{align-content:start}.asset-preview{position:relative;height:150px;display:grid;place-items:center;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:#f5f7f5}.asset-preview img{width:100%;height:100%;object-fit:contain;background:#fff}.asset-preview span{position:absolute;right:8px;bottom:8px;padding:5px 8px;border-radius:7px;background:#142a22d9;color:#fff;font-size:11px;font-weight:700}.asset-preview.empty span{position:static;background:transparent;color:var(--muted);font-size:13px}
.modal-card form>footer{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:10px;padding:16px 24px;border-top:1px solid var(--line);background:#fff}.modal-save{width:auto;min-width:110px;height:40px;margin:0;padding:0 20px}
.toast{position:fixed;right:24px;bottom:24px;z-index:80;max-width:420px;padding:14px 18px;border-radius:10px;background:var(--green);color:#fff;box-shadow:0 14px 45px #10251e45;font-weight:800}.toast.danger{background:var(--danger)}
@media(max-width:1000px){.login-view{grid-template-columns:1fr}.brand-panel{display:none}.app-shell{grid-template-columns:1fr}.sidebar{display:none}.stats-grid,.module-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-height:720px){.login-view{height:auto;min-height:100vh;overflow:auto}.login-card{padding-top:28px;padding-bottom:28px}}
@media(max-width:650px){.login-panel{padding:22px}.login-card{padding:28px 22px}.topbar{padding:0 16px}.top-user,.wordmark small,#legacyButton{display:none}.main-content{padding:24px 16px}.stats-grid,.module-grid,.form-grid,.module-checklist,.endpoint-grid{grid-template-columns:1fr}.wide{grid-column:auto}.page-heading{gap:14px}.primary-action{flex:none}.modal{padding:10px}#modalBody{padding:18px}}
