:root { --bg:#F5F2E9; --card:#F5F2E9; --text:#1a1a1a; --muted:#5f6368; --primary:#1a1a1a; --border:#e0e3e7; --header-h:64px; --footer-h:48px; --app-font:'AlimamaDongFangDaKai', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
@font-face {
    font-family: 'AlimamaDongFangDaKai';
    src: url('./AlimamaDongFangDaKai-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--app-font) !important; background: url('images/NorDi.png') no-repeat center center fixed; background-size: cover; color: var(--text); height: 100vh; overflow: hidden; padding-top: var(--header-h); padding-bottom: 70px !important; }
@supports (-webkit-touch-callout: none) { body { background-attachment: scroll; } }
body :is(h1,h2,h3,h4,h5,h6,p,span,div,a,button,input,select,textarea,label,li,td,th,strong,small,em,b,i) { font-family: var(--app-font) !important; }
input::placeholder, textarea::placeholder { font-family: var(--app-font) !important; }
.app-header { position: fixed; top: 0; left: 0; right: 0; background: linear-gradient(180deg, rgba(245,242,233,.95), rgba(245,242,233,.7)); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 12px 16px; z-index: 100; }
.app-header h1 { margin: 0; font-size: 20px; }
.subtitle { color: var(--muted); font-size: 12px; margin-top: 4px; }
.container { max-width: 640px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; height: calc(100vh - var(--header-h) - 70px); overflow: hidden; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.animation-card { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.result-card { flex: 0 0 auto; max-height: clamp(140px, 28vh, 240px); overflow-y: auto; display: flex; flex-direction: column; }
.form-card form { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); }
input { width: 100%; padding: 12px 12px; border-radius: 10px; border: 1px solid var(--border); background: #ffffff; color: var(--text); outline: none; }
input:focus { border-color: #c5c9d3; }
select { width: 100%; padding: 12px 12px; border-radius: 10px; border: 1px solid var(--border); background: #ffffff; color: var(--text); outline: none; }
.sections { display: grid; gap: 10px; margin-top: 10px; }
.section { border: 1px dashed var(--border); border-radius: 10px; padding: 10px; background: #ffffff; }
.section-title { font-weight: 600; color: var(--text); margin-bottom: 6px; }
.section-body { color: var(--text); white-space: pre-wrap; line-height: 1.7; font-size: 15px; }
.section-body strong { color: #000; font-weight: 600; }
.section-body li { margin-left: 20px; margin-bottom: 4px; }
.section-body p { margin-bottom: 12px; margin-top: 0; }
.primary { appearance: none; border: none; background: var(--primary); color: white; padding: 12px 24px; border-radius: 30px; font-size: 15px; font-weight: 500; }
.primary:disabled { opacity: .6; }
.secondary { appearance: none; border: 1px solid var(--border); background: rgba(255,255,255,0.8); color: var(--text); padding: 12px 24px; border-radius: 30px; font-size: 15px; font-weight: 500; }
.hint { margin-top: 8px; font-size: 12px; color: var(--muted); }
.result-header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.status { color: #7bd88f; }
.stream { white-space: pre-wrap; line-height: 1.6; font-size: 15px; }
.app-footer { position: fixed; bottom: 0; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 12px; padding: 12px 16px; background: rgba(255,255,255,.95); border-top: 1px solid var(--border); z-index: 100; }
@media (max-width: 400px) { .container { padding: 10px; } }

/* Permanent Bottom Navigation Bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: url('images/BottowDiNew.png?v=20260403_bottom_bg_v1') repeat-x center bottom;
    background-size: auto 100%;
    border-top: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 20000;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-tab-btn {
    flex: 1;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.bottom-tab-text {
    font-family: var(--app-font);
    font-size: 20px;
    line-height: 1;
    letter-spacing: 1px;
    color: rgba(26, 26, 26, 0.38);
    transform: translateY(1px);
    transition: all 0.2s;
}
.fonts-loading .bottom-tab-text { visibility: hidden; }
.fonts-ready .bottom-tab-text { visibility: visible; }

.bottom-tab-btn svg {
    width: 24px;
    height: 24px;
    transition: all 0.2s;
}

.bottom-tab-btn img {
    width: 24px;
    height: 24px;
    opacity: 0.4;
    transition: all 0.2s;
}

.bottom-tab-btn.active {
    color: #1a1a1a;
}

.bottom-tab-btn.active::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 46px;
    height: 6px;
    background: #ff2b2b;
    border-radius: 999px;
}

.bottom-tab-btn.active svg {
    transform: scale(1.1);
}

.bottom-tab-btn.active img {
    opacity: 1;
    transform: scale(1.05);
}

.bottom-tab-btn.active .bottom-tab-text {
    color: #1a1a1a;
    transform: scale(1.06) translateY(0);
}

/* NEW Full Screen Login Styles */
.login-full-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('images/NorDi.png') no-repeat center center fixed;
    background-size: cover;
    z-index: 30000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto; /* Allow scrolling if content is tall */
}

.login-full-page.active {
    display: flex;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 20px;
    padding: 30px 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 10px;
}

.login-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #1a1a1a;
}

.login-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.login-tabs {
    display: flex;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.login-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.login-tab.active {
    background: #ffffff;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.login-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.login-panel.active {
    display: flex;
}

.input-group {
    width: 100%;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    background: #f9f9f9;
    transition: all 0.2s;
    outline: none;
}

.input-group input:focus {
    background: #fff;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.1);
}

.input-group.row {
    display: flex;
    gap: 10px;
}

.btn-code {
    white-space: nowrap;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.btn-code:disabled {
    color: #999;
    background: #f5f5f5;
    cursor: not-allowed;
}

.login-btn-primary {
    width: 100%;
    padding: 14px;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 8px;
}

.login-btn-primary:active {
    opacity: 0.8;
}

.login-status-msg {
    text-align: center;
    font-size: 13px;
    min-height: 20px;
    color: #e74c3c;
}
