:root {
    /* Brand Colors - Official Palette from Rainbow House CIS Manual (106-04-25 / OL.ai) */
    --brand-primary: #00aeba;        /* 官方主色 RGB(0,174,187) 卡里善青綠 */
    --brand-primary-dark: #008b94;   /* 深邃湖藍綠 */
    --brand-accent: #e4007f;         /* 官方強調色 (活力亮桃紅 / Magenta) */
    --brand-green: #10b981;
    --brand-green-dark: #059669;
    
    /* Official Auxiliary Pastel Candy Palette (CIS Manual Pages 22-26) */
    --cis-pastel-yellow: #F7AB00;    /* Page 22 溫暖金黃 RGB(247,171,0) */
    --cis-pastel-mint: #A4D5C1;      /* Page 23 粉彩薄荷綠 RGB(164,213,193) */
    --cis-pastel-peach: #F29B8F;     /* Page 24 粉彩珊瑚桃紅 RGB(242,155,143) */
    --cis-pastel-lavender: #A5A3D0;  /* Page 25 粉彩薰衣草紫 RGB(165,163,208) */
    --cis-pastel-cyan: #33BEC8;      /* Page 26 粉彩天空藍綠 RGB(51,190,200) */
    
    --brand-rainbow: linear-gradient(135deg, #F29B8F 0%, #F7AB00 25%, #A4D5C1 50%, #00aeba 75%, #A5A3D0 100%);
    --brand-subtle: #e6f7f8;         /* 彩虹屋主色極淡底色 */

    /* Neutrals */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Elevations & Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(180deg, #f4fcfc 0%, #fffefc 100%);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 110px;
    min-height: 100vh;
}

/* App Header - 潔淨白底與品牌彩虹底線 */
.app-header {
    background: #ffffff;
    color: #1e293b;
    padding: 16px 20px 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    border-bottom: 3px solid transparent;
    border-image: var(--brand-rainbow);
    border-image-slice: 1;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-header.collapsed {
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.brand-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    gap: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
    border: none;
    outline: none;
    filter: none;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.brand-logo-img:hover {
    transform: scale(1.03);
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 1px;
    color: #0f3d44;
    white-space: nowrap;
}

.brand-sub {
    font-size: 0.75rem;
    color: #5f7a80;
    white-space: nowrap;
}

/* 英文語系專屬縮小字級與防跑版設定 */
body[data-lang="en"] .brand-name {
    font-size: 0.94rem;
    letter-spacing: 0;
}

body[data-lang="en"] .brand-sub {
    font-size: 0.64rem;
}

body[data-lang="en"] .nav-tab {
    font-size: 0.78rem;
    padding: 10px 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Language Selector (多語介面 - 粉彩按鈕配色) */
.lang-selector {
    display: flex;
    align-items: center;
    background: rgba(0, 174, 186, 0.08);
    border-radius: var(--radius-full);
    padding: 2px;
    border: 1px solid rgba(0, 174, 186, 0.2);
}

.lang-btn {
    background: transparent;
    border: none;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.lang-btn.active {
    background: var(--brand-primary);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 174, 186, 0.3);
}

.uid-switch-btn {
    background: #fff0f6;
    border: 1px solid #fbcfe8;
    color: #be185d;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.2s;
}

.uid-switch-btn:hover {
    background: #fce7f3;
}

/* =========================================================
   第一畫面：會員專屬 Hero QR Code Card (進入網頁預設顯示，下滑後縮合)
   ========================================================= */
.hero-qr-card {
    background: linear-gradient(145deg, #ffffff 0%, #f2fcfc 60%, #fffbf2 100%);
    border: 2px solid rgba(0, 174, 186, 0.28);
    border-radius: var(--radius-lg);
    padding: 22px 18px 16px;
    margin: 12px 0 8px;
    box-shadow: 0 8px 24px rgba(0, 174, 186, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 650px;
}

.hero-qr-card.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    border: none;
    pointer-events: none;
}

.hero-qr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed rgba(0, 174, 186, 0.25);
}

.hero-avatar-wrap {
    position: relative;
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    margin-bottom: 6px;
}

.hero-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--brand-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hero-vip {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.54rem;
    padding: 1px 6px;
    background: linear-gradient(135deg, #ffde00 0%, #f59e0b 100%);
    color: #451a03;
    font-weight: 800;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.45);
    border: 1.5px solid #fff;
    white-space: nowrap;
    line-height: 1.2;
    z-index: 2;
}

.hero-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-display-name {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f3d44;
}

.hero-sub-tag {
    font-size: 0.85rem;
    color: var(--brand-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-qr-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.qr-container {
    background: #ffffff;
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.qr-container img {
    width: 200px;
    height: 200px;
    display: block;
}

.qr-caption {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qr-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f3d44;
}

.qr-caption code {
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: #475569;
    font-family: monospace;
}

.dynamic-scroll-pill {
    margin-top: 22px;
    background: linear-gradient(135deg, #e0f2fe 0%, #ccfbf1 100%);
    border: 1.5px solid var(--brand-primary);
    border-radius: var(--radius-full);
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f3d44;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 174, 186, 0.22);
    animation: scrollPillFloat 1.8s infinite ease-in-out;
    position: relative;
    z-index: 100;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.dynamic-scroll-pill:hover {
    transform: scale(1.04);
}

@keyframes scrollPillFloat {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 4px 14px rgba(0, 174, 186, 0.22);
    }
    50% {
        transform: translateY(6px);
        box-shadow: 0 8px 22px rgba(0, 174, 186, 0.38);
    }
}

.scroll-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.6;
}

.arrow-down-1 {
    font-size: 0.75rem;
    color: var(--brand-primary);
    animation: arrowPulse 1.2s infinite 0s;
}

.arrow-down-2 {
    font-size: 0.75rem;
    color: var(--brand-primary);
    animation: arrowPulse 1.2s infinite 0.3s;
}

@keyframes arrowPulse {
    0% { opacity: 0.25; transform: translateY(-2px); }
    50% { opacity: 1; transform: translateY(2px); }
    100% { opacity: 0.25; transform: translateY(-2px); }
}

/* =========================================================
   網頁往下滑動後的精簡排版與導覽列：永遠保持置頂 (對齊官網 navbar-fixed-top drop-shadow)
   ========================================================= */
.sticky-top-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-top-container.is-fixed,
.sticky-top-container.navbar-fixed-top,
.sticky-top-container:has(.profile-banner.scrolled-visible) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1030 !important;
    background: #ffffff !important;
    box-shadow: 0 6px 20px rgba(0, 174, 186, 0.16), 0 3px 10px rgba(0, 0, 0, 0.08) !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

/* 官方樣式對準：獨立支援 drop-shadow 類別 */
.drop-shadow {
    box-shadow: 0 6px 20px rgba(0, 174, 186, 0.16), 0 3px 10px rgba(0, 0, 0, 0.08) !important;
}

/* margin-top 由 JS 動態設定（參考官網 content-wrapper 模式），CSS 不干預 */

/* 網頁滑動後的精簡導覽橫幅 (下滑時出現) */
.sticky-top-container .profile-banner.scrolled-hidden,
.profile-banner.scrolled-hidden {
    max-height: 0;
    opacity: 0;
    padding: 0 16px;
    margin: 0;
    border: none;
    overflow: hidden;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-top-container .profile-banner.scrolled-visible,
.profile-banner.scrolled-visible {
    max-height: 120px;
    opacity: 1;
    padding: 10px 16px;
    margin: 0;
    border: none;
    border-bottom: 1px solid rgba(0, 174, 186, 0.18);
    border-radius: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfd 100%);
    pointer-events: auto;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px;
    box-shadow: none;
}

.show-qr-mini-btn {
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 174, 186, 0.3);
    transition: transform 0.2s;
}

.show-qr-mini-btn:hover {
    transform: scale(1.04);
}

/* Profile Banner (清新柔白與湖綠粉彩卡) */
.profile-banner {
    background: linear-gradient(135deg, #ffffff 0%, #eefbfb 100%);
    border: 1px solid rgba(0, 174, 186, 0.25);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 14px rgba(0, 174, 186, 0.06);
}

.profile-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-wrapper {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 174, 186, 0.15);
}

.vip-badge {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffde00 0%, #f59e0b 100%);
    color: #451a03;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.display-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f3d44;
}

.uid-tag {
    background: #06c755;
    color: white;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    word-break: break-all;
}

.system-sync-status, .odoo-sync-status {
    font-size: 0.78rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 5px;
}

.system-sync-status.connected i, .odoo-sync-status.connected i {
    color: #10b981;
}

.stat-mini {
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.stat-mini.green-score .stat-val {
    color: #34d399;
}

.stat-val {
    font-weight: 700;
    font-size: 1.2rem;
}

.stat-label {
    font-size: 0.68rem;
    color: #cbd5e1;
}

/* Nav Tabs */
.nav-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.sticky-top-container .nav-tabs {
    position: relative;
    top: auto;
    box-shadow: none;
}

.nav-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 13px 6px;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

.tab-badge {
    background: #ff3b30;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 6px;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 5px rgba(255, 59, 48, 0.45);
    transform: translateY(-2px);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Main Content & Tabs */
.main-content {
    max-width: 680px;
    margin-top: 0;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
    padding: 130px 20px 28px;
    transition: margin-top 0.25s ease;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-intro {
    margin-bottom: 18px;
}

.section-intro h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-intro p {
    font-size: 0.86rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* DIGITAL WARRANTY CARD (KPI: 數位保固卡介面) */
.uid-sync-selector {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.uid-sync-selector label {
    display: block;
    font-size: 0.84rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.umbrella-switch-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.umb-pill {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.umb-pill:hover {
    background: #e2e8f0;
}

.umb-pill.active {
    background: var(--brand-subtle);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    box-shadow: 0 2px 6px rgba(0, 174, 186, 0.25);
}

/* PURCHASED UMBRELLAS LIST (愛傘購買紀錄列表卡片介面 - CIS Pastel Candy) */
.purchased-umbrellas-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.list-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px dashed #e2e8f0;
}

.list-section-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.purchased-umbrellas-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.umbrella-list-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.umbrella-list-card:hover {
    border-color: var(--cis-pastel-mint);
    box-shadow: 0 4px 12px rgba(0, 174, 186, 0.08);
}

.umbrella-list-card.active {
    background: linear-gradient(135deg, #f4fcfc 0%, #edfcfc 100%);
    border-color: var(--brand-primary);
    box-shadow: 0 4px 16px rgba(0, 174, 186, 0.15);
}

.umb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 10px;
}

.umb-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.umb-card-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f3d44;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.umb-card-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.umb-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.umb-meta-label {
    color: var(--text-muted);
}

.umb-meta-val {
    color: var(--text-primary);
    font-weight: 600;
}

.umb-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.btn-umb-repair {
    background: var(--brand-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 174, 186, 0.25);
}

.btn-umb-repair:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 174, 186, 0.35);
}

.btn-umb-passport {
    background: #ffffff;
    color: var(--brand-primary);
    border: 1.5px solid var(--brand-primary);
    border-radius: var(--radius-full);
    padding: 7px 15px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-umb-passport:hover {
    background: var(--brand-subtle);
}

.btn-umb-passport.active {
    background: var(--brand-subtle);
    border-color: var(--brand-primary-dark);
    color: var(--brand-primary-dark);
}

.digital-warranty-card {
    background: linear-gradient(135deg, #ffffff 0%, #edfcfc 55%, #fdf2f8 100%);
    color: #1e293b;
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 174, 186, 0.1);
    border: 1.5px solid #a5f3fc;
    position: relative;
    overflow: hidden;
}

.digital-warranty-card::after {
    content: "";
    position: absolute;
    top: -20px;
    right: -20px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(0, 174, 186, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.warranty-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.warranty-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #008b94;
}

.warranty-status-badge {
    background: #d1fae5;
    color: #047857;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #a7f3d0;
}

.warranty-product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.wp-left h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f3d44;
}

.wp-specs {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.78rem;
    color: #475569;
}

.wp-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    padding: 10px;
    border-radius: var(--radius-md);
    color: #0f3d44;
    border: 1px solid #e2e8f0;
}

.qr-code-box {
    font-size: 2.8rem;
    line-height: 1;
}

.wp-qr small {
    font-size: 0.68rem;
    font-weight: 700;
}

.warranty-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-top: 16px;
    border-top: 1px dashed #cffafe;
}

.w-meta {
    display: flex;
    flex-direction: column;
}

.w-meta .meta-label {
    font-size: 0.72rem;
    color: #64748b;
}

.w-meta strong {
    font-size: 0.88rem;
    color: #0f3d44;
}

/* ESG CARBON REDUCTION DASHBOARD (KPI: 減碳數據顯示介面) */
.esg-carbon-dashboard {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.esg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.esg-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.esg-title i {
    font-size: 1.5rem;
    color: var(--brand-green);
}

.esg-title strong {
    display: block;
    font-size: 0.98rem;
}

.esg-title small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.esg-badge {
    background: #ecfdf5;
    color: #059669;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.carbon-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    text-align: center;
}

.metric-card.primary {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.metric-icon {
    font-size: 1.3rem;
    color: var(--brand-green);
    margin-bottom: 6px;
}

.metric-val {
    font-size: 1.3rem;
    font-weight: 700;
    color: #065f46;
}

.metric-val small {
    font-size: 0.75rem;
}

.metric-label {
    font-size: 0.74rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.carbon-explain-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.82rem;
    color: #166534;
}

.carbon-explain-box i {
    color: var(--brand-green);
    margin-top: 3px;
}

/* LIFECYCLE REPAIR HISTORY */
.lifecycle-list {
    padding: 16px 18px;
}

.lifecycle-item {
    display: flex;
    gap: 14px;
    padding-bottom: 18px;
    position: relative;
}

.lifecycle-item:last-child {
    padding-bottom: 0;
}

.lifecycle-item::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 14px;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.lifecycle-item:last-child::before {
    display: none;
}

.life-dot {
    width: 14px;
    height: 14px;
    border-radius: var(--radius-full);
    background: var(--border-color);
    flex-shrink: 0;
    margin-top: 3px;
    position: relative;
    z-index: 2;
}

.life-dot.active {
    background: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.life-dot.done {
    background: var(--success);
}

.life-content {
    flex: 1;
}

.life-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.life-head strong {
    font-size: 0.92rem;
}

.life-head span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.life-content p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* GREEN MEMBER REWARDS (KPI: 會員綠色消費獎勵規劃) */
.green-member-card {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.g-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.g-subtitle {
    font-size: 0.72rem;
    color: #a7f3d0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.g-points-box {
    text-align: right;
}

.pts-number {
    font-size: 2rem;
    font-weight: 700;
    color: #6ee7b7;
    line-height: 1;
    display: block;
}

.pts-unit {
    font-size: 0.72rem;
    color: #d1fae5;
}

.g-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 12px;
}

.g-progress-fill {
    height: 100%;
    background: #6ee7b7;
    border-radius: var(--radius-full);
}

.g-foot {
    font-size: 0.78rem;
    color: #ecfdf5;
}

.green-redemption-records {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
    color: #7c2d12;
}

.green-redemption-records-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.green-redemption-records-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.96rem;
    font-weight: 800;
    color: #9a3412;
}

.green-redemption-records-title i {
    color: #ea580c;
}

.green-redemption-records-desc {
    font-size: 0.76rem;
    color: #c2410c;
    margin-top: 3px;
}

.green-redemption-records-badge {
    flex: 0 0 auto;
    background: #ffedd5;
    border: 1px solid #fdba74;
    border-radius: 999px;
    color: #c2410c;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 9px;
}

.green-redemption-record-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.green-redemption-record {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #fed7aa;
    border-radius: 9px;
    padding: 9px 11px;
}

.green-redemption-record-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: #431407;
}

.green-redemption-record-amount {
    flex: 0 0 auto;
    color: #dc2626;
    font-size: 1.05rem;
    font-weight: 900;
}

.green-redemption-record-amount small {
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 2px;
}

.green-redemption-empty {
    color: #9a3412;
    font-size: 0.8rem;
    text-align: center;
    padding: 5px 0 2px;
}

@media (max-width: 520px) {
    .green-redemption-records-head {
        align-items: flex-start;
    }

    .green-redemption-records-badge {
        font-size: 0.64rem;
        padding: 3px 7px;
    }
}

.rewards-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.reward-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.reward-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: #ecfdf5;
    color: var(--brand-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.reward-info {
    flex: 1;
}

.reward-info h4 {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.reward-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-reward {
    background: var(--brand-green);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reward:hover {
    background: var(--brand-green-dark);
}


/* Spacer Paragraph / Section Separation */
.spacer-paragraph {
    height: 36px;
    width: 100%;
}

/* Official Policy Card & Repair Guidelines */
.official-policy-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1.5px solid #e2e8f0;
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.policy-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
}

.policy-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.policy-title i {
    color: var(--brand-primary);
    font-size: 1.2rem;
}

.policy-badge {
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}

.policy-arrow {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.policy-header.collapsed .policy-arrow {
    transform: rotate(-90deg);
}

.policy-header.collapsed {
    border-bottom: none;
}

.policy-content {
    padding: 20px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.35s ease;
    opacity: 1;
}

.policy-content.collapsed {
    max-height: 0;
    padding: 0 20px;
    opacity: 0;
}

.policy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.policy-box {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.policy-box.success-box {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.policy-box.success-box h4 {
    color: #15803d;
    font-size: 0.96rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.policy-box.success-box .policy-sub {
    font-size: 0.84rem;
    color: #166534;
    margin-bottom: 8px;
    font-weight: 600;
}

.policy-box.success-box ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.84rem;
    color: #15803d;
    line-height: 1.6;
}

.policy-note {
    display: block;
    margin-top: 10px;
    font-size: 0.78rem;
    color: #166534;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 8px;
    border-radius: 4px;
}

.policy-box.warning-box {
    background: #fff1f2;
    border-color: #fecdd3;
}

.policy-box.warning-box h4 {
    color: #be123c;
    font-size: 0.96rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.policy-box.warning-box ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.84rem;
    color: #9f1239;
    line-height: 1.6;
}

.policy-box.warning-box ul li strong {
    color: #881337;
}

/* Inline Hint & Shipping Tips */
.hint-inline-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: #c2410c;
    line-height: 1.5;
}

.hint-inline-box i {
    color: #f97316;
    margin-top: 2px;
}

.hq-address-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--brand-primary-dark);
    font-weight: 600;
}

.smart-shipping-tip {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px dashed #f59e0b;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.smart-shipping-tip .tip-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f59e0b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.smart-shipping-tip .tip-content strong {
    font-size: 0.95rem;
    color: #b45309;
    display: block;
    margin-bottom: 4px;
}

.smart-shipping-tip .tip-content p {
    font-size: 0.84rem;
    color: #92400e;
    line-height: 1.6;
    margin: 0;
}


/* Form Cards & Common */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: #f8fafc;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-fill-tag {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.btn-text {
    background: none;
    border: none;
    color: var(--brand-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.contact-preview-grid {
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-item.full-width {
    grid-column: span 2;
}

.contact-item label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.contact-item input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-body {
    padding: 18px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.required {
    color: var(--danger);
}

.quick-select-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.chip {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 7px 12px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.chip.active {
    background: var(--brand-subtle);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.toggle-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.toggle-card input {
    display: none;
}

.toggle-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
}

.toggle-card input:checked + .toggle-box {
    border-color: var(--brand-primary);
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.fault-section {
    padding: 16px 0;
    border-bottom: 1px dashed var(--border-color);
}

.fault-section.no-border {
    border-bottom: none;
}

.fault-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.fault-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.fault-label strong {
    display: block;
    font-size: 0.95rem;
}

.fault-label small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.fault-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.fault-tag {
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
}

.fault-tag.selected {
    background: #fef2f2;
    border-color: var(--danger);
    color: var(--danger);
    font-weight: 700;
}

.counters-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.counter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.counter-title {
    font-weight: 600;
    font-size: 0.92rem;
    display: block;
}

.counter-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.counter-ctrl {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-count {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
}

.counter-ctrl input {
    width: 48px;
    text-align: center;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    padding: 6px 0;
    font-weight: 700;
    font-size: 1rem;
    color: var(--brand-primary);
}

.photo-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: #f8fafc;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.upload-placeholder i {
    font-size: 1.8rem;
    color: var(--brand-primary);
}

.photo-preview-list {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.preview-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.choice-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.choice-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: white;
}

.choice-card input {
    display: none;
}

.choice-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.choice-text strong {
    font-size: 0.95rem;
    display: block;
}

.choice-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.choice-card.active,
.choice-card:has(input:checked) {
    border-color: var(--brand-primary);
    background: var(--brand-subtle);
}

.choice-card.active .choice-icon,
.choice-card:has(input:checked) .choice-icon {
    background: var(--brand-primary);
    color: white;
}

.notice-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.notice-box i {
    color: var(--warning);
    font-size: 1.3rem;
}

.notice-text strong {
    font-size: 0.92rem;
    color: #92400e;
    display: block;
}

.notice-text p {
    font-size: 0.82rem;
    color: #b45309;
}

.btn-submit {
    width: 100%;
    background: var(--brand-primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 174, 186, 0.4);
    transition: all 0.2s;
}

.btn-submit:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-1px);
}

/* Tickets list */
.search-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
}

.btn-filter {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
}

.ticket-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 18px;
    margin-bottom: 16px;
}

.ticket-card.active-repair {
    border-left: 5px solid var(--brand-primary);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ticket-badge.progress {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.ticket-badge.completed {
    background: #dcfce7;
    color: #15803d;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.ticket-badge.cancelled {
    background: #dbeafe;
    color: #0369a1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.ticket-product {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-badge {
    background: #f1f5f9;
    color: #334155;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.ticket-fault-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tag-chip {
    background: #f1f5f9;
    font-size: 0.78rem;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

.timeline-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 14px;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.timeline-step.done .step-circle {
    background: var(--success);
    color: white;
}

.timeline-step.active .step-circle {
    background: var(--brand-primary);
    color: white;
}

.step-label {
    font-size: 0.78rem;
    font-weight: 600;
}

.timeline-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 4px;
    margin-bottom: 18px;
}

.timeline-line.done {
    background: var(--success);
}

.ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
}

.ticket-ref, .odoo-ref {
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-outline-sm {
    background: white;
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 460px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.member-qr-modal-card {
    background: linear-gradient(160deg, #ffffff 0%, #f0fcfc 70%, #fffbf0 100%);
    border: 2px solid rgba(0, 174, 186, 0.35);
    padding: 24px 22px;
}

.modal-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.btn-close-icon {
    background: rgba(0, 0, 0, 0.06);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.btn-close-icon:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.member-modal-avatar-wrap {
    width: 86px;
    height: 86px;
    margin: 0 auto 12px;
    position: relative;
}

.member-modal-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 14px rgba(0, 174, 186, 0.25);
}

.member-modal-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f3d44;
    margin-bottom: 4px;
}

.member-modal-sub {
    font-size: 0.85rem;
    color: var(--brand-primary);
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.member-modal-sub code {
    background: rgba(0, 174, 186, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
}

.member-modal-qr-box {
    background: #ffffff;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 2px dashed rgba(0, 174, 186, 0.3);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.member-modal-qr-box img {
    width: 220px;
    height: 220px;
    object-fit: contain;
}

.modal-icon-success {
    font-size: 3.5rem;
    color: var(--success);
    margin-bottom: 12px;
}

.order-summary-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: left;
    margin: 18px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}

.summary-row:last-child {
    border-bottom: none;
}

#modalFaultSummary {
    white-space: pre-line;
    text-align: right;
    max-width: 68%;
    line-height: 1.5;
    color: var(--text-main);
}

.ticket-highlight {
    color: var(--brand-primary);
    font-family: monospace;
}

.barcode-visual {
    background: #f1f5f9;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
    font-family: monospace;
}

.barcode-lg {
    font-size: 3.2rem;
    color: #1e293b;
    letter-spacing: 4px;
}

.btn-modal-primary {
    width: 100%;
    background: var(--brand-primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
}

.debug-modal {
    text-align: left;
}

.uid-preset-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.uid-preset {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
}

.uid-preset.active {
    border-color: var(--brand-primary);
    background: var(--brand-subtle);
}

/* =========================================================
   線上報修專屬：購買過愛傘列表選擇卡片區 (如 我的傘庫列表)
   ========================================================= */
.repair-purchase-history-section {
    margin: 1rem 0 1.2rem 0;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.history-section-title {
    font-weight: 700;
    color: #0f3d44;
    font-size: 0.95rem;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-section-title i {
    color: var(--brand-primary);
    font-size: 1.1rem;
}

.repair-purchase-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.repair-history-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.repair-history-card:hover {
    border-color: #94a3b8;
    background: #fcfcfd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.repair-history-card.active {
    border-color: var(--brand-primary);
    background: #f0fdf4;
    box-shadow: 0 2px 8px rgba(15, 61, 68, 0.08);
}

.repair-history-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 600;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.repair-history-main {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.repair-history-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    word-break: break-word;
}

.repair-code-tag {
    color: var(--brand-primary);
    font-family: monospace;
    font-weight: 700;
    background: #e0f2fe;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
}

.repair-history-check {
    color: #cbd5e1;
    font-size: 1.25rem;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.repair-history-card.active .repair-history-check {
    color: var(--brand-primary);
}

@media screen and (max-width: 520px) {
    .repair-history-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        position: relative;
        padding-right: 2.8rem;
    }
    .repair-history-date-badge {
        font-size: 0.8rem;
    }
    .repair-history-check {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
}

/* =========================================================
   RWD 響應式適配 (Responsive Web Design Media Queries)
   支援：超小手機螢幕 (<390px)、標準手機 (<480px)、平板與桌面 (>768px)
   ========================================================= */

/* 小螢幕手機適配 (手機寬度低於 480px，如 iPhone SE, Mini, 標準 Android 手機) */
@media screen and (max-width: 480px) {
    body {
        padding-bottom: 95px;
    }

    .brand-logo-img {
        height: 38px;
    }

    .app-header {
        padding: 14px 14px 16px;
    }

    .brand-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .brand-name {
        font-size: 1.04rem;
    }

    .brand-sub {
        font-size: 0.62rem;
    }

    .header-actions {
        width: auto;
        flex-shrink: 0;
    }

    .lang-selector {
        padding: 2px;
    }

    .lang-btn {
        padding: 3px 6px;
        font-size: 0.68rem;
    }

    .profile-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 10px;
    }

    .profile-left {
        width: 100%;
    }

    .nav-tab {
        padding: 10px 4px;
        font-size: 0.76rem;
    }

    .nav-tab i {
        font-size: 0.95rem;
    }

    .main-content {
        /* margin-top 由 JS 控制，這裡只調左右 / 下和 padding */
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 0;
        padding: 130px 14px 14px;
    }

    /* 將聯絡人二欄表單改為全寬單欄，避免手機螢幕擁擠 */
    .contact-preview-grid {
        grid-template-columns: 1fr;
    }

    .contact-item.full-width {
        grid-column: span 1;
    }

    /* 故障原因點選按鈕，從小手機改為雙欄大觸控區，更易點選 */
    .fault-options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* 減碳儀表板卡片在窄螢幕自動優化字體與排版 */
    .carbon-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .metric-card {
        padding: 10px 6px;
    }

    .metric-val {
        font-size: 1.05rem;
    }

    .metric-label {
        font-size: 0.68rem;
    }

    /* 愛傘履歷卡適配 */
    .warranty-product-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .wp-qr {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 12px;
    }

    .warranty-meta-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .modal-card {
        padding: 20px 16px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* 超小手機螢幕特別調校 (小於 360px) */
@media screen and (max-width: 360px) {
    .carbon-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .toggle-cards {
        grid-template-columns: 1fr;
    }
}

/* 平板與桌上型大螢幕適配 (>768px) */
@media screen and (min-width: 768px) {
    .main-content {
        max-width: 720px;
        /* margin-top 由 JS 控制，這裡只調左右 / 下和 padding */
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 0;
        padding: 130px 20px 28px;
    }

    .app-header {
        padding: 20px 32px 24px;
    }

    .profile-banner {
        padding: 18px 24px;
    }

    .fault-options-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 初始畫面隱藏主內容區，讓導覽列剛好停在畫面最下方；點擊或滑動再展開並抓 Webhook */
.content-deferred-hidden {
    display: none !important;
}

/* 首購折$50開關樣式 (iOS 原生高質感開關，靠右對齊) */
.discount-toggle-wrap {
    margin-left: auto !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}
.toggle-switch-ui {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.toggle-switch-ui input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 31px;
    border: 1.5px solid #cbd5e1;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 25px;
    width: 25px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.08);
}
.toggle-switch-ui input:checked + .toggle-slider {
    background-color: #34c759;
    border-color: #34c759;
}
.toggle-switch-ui input:checked + .toggle-slider:before {
    transform: translateX(20px);
}
.discount-toggle-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f3d44;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* 拼布班學員作品展示相片牆與互動燈箱 */
.patchwork-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
}
@media (min-width: 640px) {
    .patchwork-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}
.patchwork-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 2px solid white;
    background: #f1f5f9;
}
.patchwork-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.patchwork-more-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    font-weight: 800;
    font-size: 0.88rem;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.patchwork-more-btn:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.45);
}

/* 全螢幕互動燈箱導覽樣式 */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 26, 0.94);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 3vw;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.photo-lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.lightbox-content-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 82vw;
    max-height: 85vh;
    margin: 0 auto;
}
.lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 14px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.65);
    object-fit: contain;
    border: 3px solid rgba(255, 255, 255, 0.9);
    transition: transform 0.25s ease;
}
.lightbox-caption-bar {
    color: white;
    margin-top: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.12);
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    letter-spacing: 0.5px;
    text-align: center;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 100000;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}
.lightbox-nav-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    z-index: 100000;
}
.lightbox-nav-btn:hover {
    background: rgba(16, 185, 129, 0.85);
    transform: scale(1.15);
}
@media (max-width: 640px) {
    .photo-lightbox {
        padding: 16px 10px;
    }
    .lightbox-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .lightbox-content-wrap {
        max-width: 76vw;
    }
}
