:root {
  --ink: #17152d;
  --muted: #77758b;
  --line: #e8e7ef;
  --surface: #ffffff;
  --canvas: #f7f7fb;
  --primary: #6753e8;
  --primary-dark: #5542d2;
  --soft-purple: #eeebff;
  --green: #218b62;
  --red: #c64155;
  --shadow: 0 22px 70px rgba(31, 25, 76, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 760; letter-spacing: -.3px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: linear-gradient(145deg, #8070f1, #523dd6); box-shadow: 0 8px 18px rgba(90, 67, 215, .26); font-weight: 800; }
.eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: 1.8px; }

.button { border: 0; border-radius: 10px; padding: 11px 17px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; color: var(--ink); background: white; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .65; cursor: wait; transform: none; }
.button.primary { color: white; background: linear-gradient(135deg, #7561ed, #5944d7); box-shadow: 0 9px 23px rgba(94, 70, 218, .25); }
.button.primary:hover { background: linear-gradient(135deg, #6c58e4, #503acb); }
.button.secondary { color: var(--primary); background: var(--soft-purple); }
.button.ghost { border: 1px solid var(--line); background: transparent; }
.button.danger-text { color: var(--red); background: #fff2f4; }
.button.full { width: 100%; padding: 13px 18px; }
.button.small { padding: 8px 12px; font-size: 13px; }
.plus { font-size: 20px; line-height: 10px; font-weight: 400; }

.field { display: grid; gap: 8px; color: #444255; font-size: 13px; font-weight: 650; }
.field small { color: #9a98a9; font-weight: 500; }
.field input { width: 100%; height: 47px; border: 1px solid #dddae7; border-radius: 10px; padding: 0 14px; outline: 0; color: var(--ink); background: white; transition: border .15s, box-shadow .15s; }
.field input:focus { border-color: #8775ee; box-shadow: 0 0 0 4px rgba(103, 83, 232, .10); }
.field input::placeholder { color: #aaa8b6; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 60px; }
.text-button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 0; color: var(--primary); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }

.notice { border-radius: 10px; padding: 11px 13px; font-size: 13px; line-height: 1.45; }
.notice.error { border: 1px solid #ffd1d7; color: #a82f43; background: #fff2f4; }
.notice.success { border: 1px solid #c6eddc; color: #19724f; background: #edfbf5; }
.notice.dismissible { margin: 0 0 18px; display: flex; justify-content: space-between; align-items: center; }
.notice.dismissible button { border: 0; color: currentColor; background: none; cursor: pointer; font-size: 19px; opacity: .65; }

/* Login */
.login-page { background: #f3f1fa; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.08fr) minmax(440px, .92fr); }
.login-brand { position: relative; overflow: hidden; padding: 46px clamp(40px, 6vw, 92px); color: white; background: radial-gradient(circle at 16% 82%, rgba(155, 125, 255, .35), transparent 25%), radial-gradient(circle at 80% 12%, rgba(128, 112, 241, .35), transparent 26%), linear-gradient(145deg, #1d183c 0%, #28204d 52%, #322561 100%); }
.login-brand .brand { position: relative; z-index: 2; }
.login-brand .brand-mark { color: #5b45d9; background: white; box-shadow: none; }
.brand-copy { position: relative; z-index: 2; margin-top: clamp(130px, 21vh, 230px); max-width: 590px; }
.brand-copy .eyebrow { color: #a99cf9; }
.brand-copy h1 { margin: 17px 0 20px; font-size: clamp(42px, 5.3vw, 70px); line-height: 1.12; letter-spacing: -3.2px; }
.brand-copy p { max-width: 430px; color: #c6c0dc; font-size: 17px; line-height: 1.7; }
.brand-orbit { position: absolute; width: 510px; height: 360px; right: -165px; bottom: -70px; border: 1px solid rgba(255,255,255,.10); border-radius: 50%; transform: rotate(-18deg); }
.orbit-card { position: absolute; display: block; border: 1px solid rgba(255,255,255,.13); border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.025)); backdrop-filter: blur(8px); box-shadow: 0 24px 50px rgba(0,0,0,.12); }
.orbit-one { width: 185px; height: 118px; left: -46px; top: 60px; }
.orbit-two { width: 150px; height: 95px; left: 112px; top: -48px; }
.orbit-three { width: 210px; height: 130px; left: 220px; top: 160px; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #faf9fd; }
.login-card { width: min(410px, 100%); padding: 38px; border: 1px solid rgba(38, 32, 73, .08); border-radius: 19px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); }
.login-card header { margin-bottom: 28px; }
.login-card h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.8px; }
.login-card header p { margin: 0; color: var(--muted); font-size: 14px; }
.login-card .field { margin: 18px 0; }
.secure-note { margin: 20px 0 0; color: #9996a7; font-size: 11px; text-align: center; }
.secure-note span { color: #56b890; font-size: 9px; }

/* Dashboard */
.topbar { height: 72px; padding: 0 max(28px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); backdrop-filter: blur(15px); position: sticky; top: 0; z-index: 20; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: #514e61; font-size: 13px; }
.avatar { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: #5945d7; background: var(--soft-purple); font-weight: 800; }
.container { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 80px; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 31px; }
.hero-row h1 { margin: 7px 0 8px; font-size: 36px; letter-spacing: -1.4px; }
.hero-row p { margin: 0; color: var(--muted); font-size: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 16px; margin-bottom: 42px; }
.stat-card { min-height: 94px; padding: 18px 20px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 7px 24px rgba(31, 25, 76, .035); }
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; font-weight: 800; }
.stat-icon.purple { color: #6c53e4; background: #efecff; }
.stat-icon.green { color: #248c67; background: #e7f8f1; }
.stat-icon.blue { color: #3d75c5; background: #eaf3ff; }
.stat-card div { display: grid; gap: 5px; }
.stat-card strong { font-size: 21px; letter-spacing: -.3px; }
.stat-card span:last-child { color: var(--muted); font-size: 12px; }
.wide-tip strong { font-size: 14px; }
.section-heading { margin-bottom: 17px; }
.section-heading > div { display: flex; align-items: baseline; gap: 10px; }
.section-heading h2 { margin: 0; font-size: 19px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.prototype-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.prototype-card { overflow: hidden; display: grid; grid-template-columns: 154px 1fr; min-height: 220px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 8px 30px rgba(31, 25, 76, .04); transition: transform .18s, box-shadow .18s; }
.prototype-card:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(31, 25, 76, .08); }
.preview-tile { position: relative; margin: 12px 0 12px 12px; overflow: hidden; border-radius: 11px; background: linear-gradient(155deg, #262141, #433771); }
.browser-dots { position: absolute; top: 13px; left: 13px; display: flex; gap: 4px; }
.browser-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.45); }
.preview-lines { position: absolute; top: 47px; left: 18px; right: 18px; display: grid; gap: 9px; }
.preview-lines b { display: block; height: 7px; border-radius: 5px; background: rgba(255,255,255,.18); }
.preview-lines b:nth-child(1) { width: 70%; height: 12px; background: rgba(255,255,255,.55); }
.preview-lines b:nth-child(2) { width: 94%; }
.preview-lines b:nth-child(3) { width: 83%; }
.preview-lines b:nth-child(4) { width: 55%; background: #8875ec; }
.html-badge { position: absolute; left: 15px; bottom: 14px; padding: 4px 7px; border-radius: 5px; color: #cbc4fa; background: rgba(0,0,0,.2); font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.card-body { min-width: 0; padding: 20px 18px; display: flex; flex-direction: column; }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.card-title-row h3 { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 0 6px; font-size: 16px; }
.card-title-row p { margin: 0; color: #9693a3; font-size: 10px; }
.status { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; color: var(--green); font-size: 10px; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: #45b58b; }
.share-field { margin-top: 20px; display: grid; gap: 7px; color: #7f7c8d; font-size: 10px; }
.share-input-row { display: flex; min-width: 0; }
.share-input-row input { min-width: 0; height: 34px; flex: 1; border: 1px solid #e3e1ea; border-radius: 8px 0 0 8px; padding: 0 9px; color: #6c687a; background: #fafafd; font-size: 10px; outline: 0; }
.copy-button { width: 49px; border: 0; border-radius: 0 8px 8px 0; color: white; background: #7561e5; cursor: pointer; font-size: 10px; font-weight: 700; }
.card-actions { margin-top: auto; padding-top: 15px; display: flex; align-items: center; gap: 8px; }
.card-actions > form:last-child { margin-left: auto; }
.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.update-button { position: relative; cursor: pointer; }
.update-button.disabled { opacity: .62; cursor: wait; pointer-events: none; }
.empty-state { padding: 75px 24px; border: 1px dashed #d9d5e8; border-radius: 17px; text-align: center; background: rgba(255,255,255,.55); }
.empty-icon { width: 62px; height: 62px; margin: 0 auto 17px; display: grid; place-items: center; border-radius: 17px; color: #7662e5; background: #edeaff; font-size: 31px; }
.empty-state h3 { margin: 0 0 8px; }
.empty-state p { margin: 0 0 21px; color: var(--muted); font-size: 13px; }

/* Modal */
.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 22px; background: rgba(19, 16, 41, .58); backdrop-filter: blur(5px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(520px, 100%); border-radius: 18px; background: white; box-shadow: 0 30px 100px rgba(12, 9, 35, .33); animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-header { padding: 25px 27px 18px; display: flex; justify-content: space-between; align-items: flex-start; }
.modal-header h2 { margin: 5px 0 0; font-size: 23px; }
.modal-close { border: 0; color: #8f8c9d; background: transparent; cursor: pointer; font-size: 27px; line-height: 1; }
.modal form { padding: 4px 27px 27px; }
.dropzone { margin: 20px 0 23px; min-height: 190px; padding: 25px; border: 1.5px dashed #c9c2ed; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); background: #faf9ff; cursor: pointer; text-align: center; }
.dropzone:hover { border-color: #8775e8; background: #f7f5ff; }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-icon { width: 44px; height: 44px; margin-bottom: 12px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: #ebe7ff; font-size: 24px; }
.dropzone strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3f3b52; font-size: 14px; }
.dropzone > span:not(.upload-icon) { margin-top: 8px; font-size: 11px; }
.dropzone em { margin-top: 12px; color: #a5a2b1; font-size: 10px; font-style: normal; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.upload-progress { margin: -6px 0 22px; padding: 14px 15px; border: 1px solid #e1def0; border-radius: 11px; background: #faf9ff; }
.progress-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; font-size: 12px; }
.progress-heading span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #504c62; font-weight: 700; }
.progress-heading strong { flex: 0 0 auto; color: var(--primary); font-size: 12px; }
.progress-track { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #e7e4f2; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #806cf0, #5b45da); transition: width .16s ease; }
.processing .progress-track i { width: 100% !important; background: linear-gradient(90deg, #806cf0 0%, #5b45da 35%, #aa9df7 50%, #5b45da 65%, #806cf0 100%); background-size: 220% 100%; animation: processing-progress 1.25s linear infinite; }
@keyframes processing-progress { to { background-position: -220% 0; } }
.upload-progress p, .transfer-progress p { margin: 8px 0 0; color: #918e9e; font-size: 10px; }
.upload-progress.error, .transfer-progress.error { border-color: #f0c7ce; background: #fff5f6; }
.upload-progress.error .progress-heading strong, .transfer-progress.error .progress-heading strong { color: var(--red); }
.upload-progress.error .progress-track i, .transfer-progress.error .progress-track i { background: var(--red); }
.transfer-progress { position: fixed; right: 26px; bottom: 26px; z-index: 75; width: min(360px, calc(100vw - 36px)); padding: 16px; border: 1px solid #ded9f2; border-radius: 13px; background: white; box-shadow: 0 18px 55px rgba(23, 18, 56, .22); }
.toast { position: fixed; left: 50%; bottom: 32px; z-index: 80; transform: translateX(-50%); padding: 11px 17px; border-radius: 9px; color: white; background: #25213c; box-shadow: 0 10px 30px rgba(0,0,0,.24); font-size: 12px; }

@media (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 300px; padding: 35px 42px; }
  .brand-copy { margin-top: 70px; }
  .brand-copy h1 { font-size: 42px; }
  .login-panel { padding: 50px 24px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .wide-tip { grid-column: 1 / -1; }
  .prototype-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .login-brand { min-height: 270px; padding: 28px 24px; }
  .brand-copy { margin-top: 55px; }
  .brand-copy h1 { font-size: 34px; letter-spacing: -1.7px; }
  .brand-copy p { font-size: 14px; }
  .login-card { padding: 28px 22px; }
  .topbar { padding: 0 18px; }
  .user-chip > span:last-child { display: none; }
  .container { width: min(100% - 30px, 1180px); padding-top: 35px; }
  .hero-row { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: 1fr; }
  .wide-tip { grid-column: auto; }
  .prototype-card { grid-template-columns: 1fr; }
  .preview-tile { height: 125px; margin: 11px 11px 0; }
  .card-title-row h3 { max-width: 190px; }
}
