/* ============================================
   LuauObf - 商用级暗色科技主题
   ============================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-0: #0a0a14;
    --bg-1: #111122;
    --bg-2: #1a1a30;
    --bg-3: #222240;
    --border: #2a2a4a;
    --text-0: #e8e8f0;
    --text-1: #a0a0c0;
    --text-2: #606080;
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --accent-glow: rgba(99,102,241,.35);
    --green: #22c55e;
    --green-bg: rgba(34,197,94,.12);
    --yellow: #eab308;
    --yellow-bg: rgba(234,179,8,.12);
    --orange: #f97316;
    --orange-bg: rgba(249,115,22,.12);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,.12);
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,.4);
    --mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    --sans: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
}

body {
    font-family: var(--sans);
    background: var(--bg-0);
    color: var(--text-0);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }

/* ============ Header ============ */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: rgba(17,17,34,.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon { font-size: 24px; }
.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-version {
    font-size: 11px;
    background: var(--accent-bg);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}

.header-nav {
    display: flex;
    gap: 4px;
}
.nav-link {
    padding: 8px 18px;
    border-radius: 8px;
    color: var(--text-1);
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
}
.nav-link:hover { background: var(--bg-2); color: var(--text-0); }
.nav-link.active {
    background: var(--accent-bg);
    color: var(--accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.credits-badge {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-1);
    font-size: 14px;
}
.btn-logout {
    background: var(--red-bg);
    color: var(--red);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all .2s;
}
.btn-logout:hover { background: var(--red); color: #fff; }

/* ============ Main ============ */
.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Page Header */
.page-header { text-align: center; margin-bottom: 36px; }
.page-title {
    font-size: 36px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}
.title-icon { font-size: 36px; }
.page-desc {
    color: var(--text-1);
    font-size: 16px;
}

/* ============ Level Cards ============ */
.level-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.level-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all .3s ease;
    position: relative;
}
.level-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.level-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow), var(--shadow);
}

.card-top-bar {
    height: 4px;
    width: 100%;
}
.bar-green  { background: linear-gradient(90deg, var(--green), #4ade80); }
.bar-yellow { background: linear-gradient(90deg, var(--yellow), #facc15); }
.bar-orange { background: linear-gradient(90deg, var(--orange), #fb923c); }

.card-body { padding: 20px; }
.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.card-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dot-green  { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-orange { background: var(--orange); }

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}
.card-price {
    font-size: 13px;
    color: var(--text-1);
    background: var(--bg-2);
    padding: 2px 10px;
    border-radius: 20px;
}
.card-badge {
    font-size: 11px;
    background: var(--orange-bg);
    color: var(--orange);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.card-features {
    list-style: none;
    margin-bottom: 16px;
}
.card-features li {
    font-size: 13px;
    color: var(--text-1);
    padding: 4px 0;
}

.card-radio {
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-radio input[type="radio"] {
    accent-color: var(--accent);
    width: 16px; height: 16px;
}
.card-radio label {
    font-size: 13px;
    color: var(--text-1);
    cursor: pointer;
}

/* ============ Selected Bar ============ */
.selected-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-1);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.selected-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
}
.selected-cost {
    color: var(--text-1);
    font-size: 13px;
}
.selected-cost b { color: var(--orange); font-size: 16px; }

.selected-options {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.opt-label {
    font-size: 12px;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.opt-label input { accent-color: var(--accent); }

/* ============ Editor ============ */
.editor-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.editor-pane {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.pane-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-1);
}
.pane-icon { font-size: 16px; }
.pane-title { font-weight: 500; flex: 1; }
.btn-copy, .btn-download {
    background: var(--bg-3);
    color: var(--text-1);
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
    margin-left: 4px;
}
.btn-copy:hover, .btn-download:hover {
    background: var(--accent);
    color: #fff;
}

.code-editor {
    width: 100%;
    min-height: 360px;
    background: var(--bg-0);
    color: var(--text-0);
    border: none;
    padding: 16px;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    tab-size: 4;
}
.code-editor::placeholder { color: var(--text-2); }

/* ============ Action Area ============ */
.action-area {
    text-align: center;
    margin-bottom: 24px;
}
.btn-obfuscate {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    padding: 16px 48px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all .3s;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-obfuscate:hover:not(:disabled) {
    transform: scale(1.03);
    box-shadow: 0 6px 30px var(--accent-glow);
}
.btn-obfuscate:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.btn-star { font-size: 20px; }

.action-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-1);
}
.action-stats b { color: var(--text-0); }

/* ============ Alerts ============ */
.alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error   { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(239,68,68,.3); }
.alert-success { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(34,197,94,.3); }

/* ============ Footer ============ */
.app-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-2);
    font-size: 12px;
    border-top: 1px solid var(--border);
}

/* ============ Login Pages ============ */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(160deg, #0f0f23 0%, #1a1a3e 50%, #2d1b69 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-brand {
    text-align: center;
    margin-bottom: 36px;
}
.brand-lock { font-size: 48px; margin-bottom: 8px; }
.login-brand h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}
.brand-sub {
    color: var(--text-1);
    font-size: 14px;
}

.login-form {
    background: rgba(17,17,34,.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-1);
    margin-bottom: 6px;
    font-weight: 500;
}
.form-group input {
    width: 100%;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-0);
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-1);
    margin-bottom: 0;
}
.link {
    color: var(--accent-2);
    font-weight: 500;
}
.link:hover { color: var(--accent); }

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.login-copy {
    text-align: center;
    margin-top: 32px;
    font-size: 11px;
    color: var(--text-2);
}

/* ============ Profile Page ============ */
.profile-main { max-width: 800px; }

.profile-hero {
    text-align: center;
    margin-bottom: 32px;
}
.hero-avatar { font-size: 64px; margin-bottom: 12px; }
.hero-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}
.hero-email {
    color: var(--text-1);
    font-size: 14px;
}

.credits-card {
    background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(139,92,246,.1));
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
}
.credits-icon { font-size: 40px; }
.credits-info { flex: 1; }
.credits-label {
    display: block;
    font-size: 13px;
    color: var(--text-1);
    margin-bottom: 4px;
}
.credits-number {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.credits-hint {
    font-size: 12px;
    color: var(--text-2);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}
.info-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.info-icon { font-size: 24px; }
.info-content { display: flex; flex-direction: column; }
.info-label { font-size: 12px; color: var(--text-2); }
.info-value { font-size: 14px; color: var(--text-0); font-weight: 500; }

.price-table {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
}
.price-table h2 {
    font-size: 18px;
    margin-bottom: 16px;
}
.price-rows { display: flex; flex-direction: column; gap: 10px; }
.price-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.price-row:last-child { border-bottom: none; }
.price-level {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    min-width: 100px;
    text-align: center;
}
.price-green  { background: var(--green-bg);  color: var(--green); }
.price-yellow { background: var(--yellow-bg); color: var(--yellow); }
.price-orange { background: var(--orange-bg); color: var(--orange); }
.price-desc { flex: 1; font-size: 14px; color: var(--text-1); }
.price-cost { font-size: 14px; font-weight: 600; color: var(--text-0); }

/* ============ About Page ============ */
.about-main { max-width: 900px; }
.about-hero {
    text-align: center;
    margin-bottom: 40px;
}
.about-logo { font-size: 64px; margin-bottom: 12px; }
.about-hero h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}
.about-tagline {
    color: var(--text-1);
    font-size: 16px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.about-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.about-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--accent-2);
}
.about-card p, .about-card ul {
    font-size: 14px;
    color: var(--text-1);
    line-height: 1.8;
}
.about-card ul { padding-left: 18px; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .level-cards { grid-template-columns: 1fr; }
    .editor-area { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .about-grid { grid-template-columns: 1fr; }
    .app-header { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
    .header-nav { order: 3; width: 100%; justify-content: center; }
}

@media (max-width: 600px) {
    .login-wrapper { padding: 20px; }
    .login-form { padding: 24px; }
    .credits-card { flex-direction: column; text-align: center; }
    .price-row { flex-wrap: wrap; }
}