/* ─── Comic/Manga Style ─────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #F9A825;
    --primary-light: #FFD54F;
    --primary-dark: #F57F17;
    --primary-bg: #FFFDE7;
    --danger: #E57373;
    --danger-bg: #FFF0ED;
    --warn: #FFB74D;
    --warn-bg: #FFF8E1;
    --success: #81C784;
    --success-bg: #F1F8E9;
    --bg: #FFFCF5;
    --card: #fff;
    --text: #3E2723;
    --text-light: #6D4C41;
    --text-muted: #BCAAA4;
    --border: #666;
    --outline: #666;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --comic-shadow: 0 2px 8px rgba(249, 168, 37, 0.15);
    --comic-shadow-sm: 0 1px 4px rgba(249, 168, 37, 0.12);
    --comic-shadow-yellow: 0 2px 10px rgba(249, 168, 37, 0.15);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Comic Neue', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    padding-bottom: 74px;
    padding-top: 64px;
    background-image: radial-gradient(circle, rgba(249, 168, 37, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: pageIn 0.4s ease-out;
}

/* ─── Keyframes ─────────────────────────────────────────────────── */
@keyframes pageIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes checkPop {
    0% { transform: scale(0); }
    60% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

@keyframes cartBounce {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
}

@keyframes comicPop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes powBurst {
    0% { transform: translateX(-50%) scale(0.3) rotate(-8deg); opacity: 0; }
    60% { transform: translateX(-50%) scale(1.1) rotate(2deg); }
    100% { transform: translateX(-50%) scale(1) rotate(0); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

/* ─── Top Nav ───────────────────────────────────────────────────── */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--card);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-bottom: 2px solid #666;
    box-shadow: 0 2px 0px rgba(249, 168, 37, 0.35);
    animation: fadeIn 0.3s ease-out;
}

.nav-title {
    font-family: 'Bangers', 'Comic Neue', cursive;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    position: relative;
}

.nav-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* ─── Tab Bar ───────────────────────────────────────────────────── */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: var(--card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    border-top: 2px solid #666;
    z-index: 100;
    box-shadow: 0 -2px 0px rgba(249, 168, 37, 0.35);
    animation: fadeIn 0.3s ease-out;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    transition: all var(--transition);
    position: relative;
}

.tab-item::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 40px;
    height: 4px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
    transition: transform var(--transition);
}

.tab-item.active {
    color: var(--primary-dark);
}

.tab-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.tab-icon {
    font-size: 24px;
    margin-bottom: 2px;
    transition: transform var(--transition);
}

.tab-item.active .tab-icon {
    transform: scale(1.2);
}

/* ─── Content ───────────────────────────────────────────────────── */
.content {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* ─── Pill Selector ─────────────────────────────────────────────── */
.selector-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease-out;
}

.selector-group {
    flex: 1;
}

.selector-group label {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pill-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pill-option {
    padding: 8px 16px;
    border: 2px solid #666;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
    font-family: inherit;
}

.pill-option:active {
    transform: translate(1px, 1px);
    box-shadow: 0 1px 3px rgba(249, 168, 37, 0.1);
}

.pill-option.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--comic-shadow-sm);
}

/* ─── Category & Menu Grid ──────────────────────────────────────── */
.category-title {
    font-family: 'Bangers', 'Comic Neue', cursive;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 20px 0 12px;
    padding: 6px 14px;
    border-left: 3px solid var(--primary);
    background: rgba(249, 168, 37, 0.06);
    letter-spacing: 1px;
}

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

.menu-card {
    background: var(--card);
    border: 2px solid #666;
    border-radius: var(--radius);
    padding: 16px 8px 10px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    user-select: none;
    animation: fadeInUp 0.4s ease-out both;
    box-shadow: var(--comic-shadow-yellow);
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(249, 168, 37, 0.03) 1px, transparent 1px);
    background-size: 6px 6px;
    pointer-events: none;
}

.menu-card:nth-child(1) { animation-delay: 0.02s; }
.menu-card:nth-child(2) { animation-delay: 0.04s; }
.menu-card:nth-child(3) { animation-delay: 0.06s; }
.menu-card:nth-child(4) { animation-delay: 0.08s; }
.menu-card:nth-child(5) { animation-delay: 0.10s; }
.menu-card:nth-child(6) { animation-delay: 0.12s; }

.menu-card:active {
    transform: scale(0.93) rotate(-1deg);
}

.menu-card.selected {
    border-color: var(--primary-dark);
    background: var(--primary-bg);
    box-shadow: 0 2px 8px rgba(245, 127, 23, 0.2);
    animation: comicPop 0.3s ease-out;
}

.menu-card .item-name {
    font-size: 14px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.menu-card .item-check {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    border: 2px solid #666;
    z-index: 1;
}

.menu-card.selected .item-check {
    display: block;
    animation: checkPop 0.3s ease-out;
}

.menu-card.selected .item-check::after {
    content: "\2713";
}

/* ─── Quantity Controls ─────────────────────────────────────────── */
.qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
    animation: scaleIn 0.25s ease-out;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 2px solid #666;
    border-radius: 50%;
    background: var(--card);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
    color: var(--text);
    padding: 0;
    font-family: inherit;
}

.qty-btn:active {
    transform: translate(1px, 1px);
    box-shadow: none;
    background: var(--primary-bg);
}

.qty-display {
    font-size: 16px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    color: var(--primary-dark);
}

/* ─── Custom Input ──────────────────────────────────────────────── */
.custom-input-section {
    margin-top: 20px;
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

.custom-cat-row {
    margin-bottom: 10px;
}

.custom-cat-row select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #666;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--card);
    transition: all var(--transition);
}

.custom-cat-row select:focus {
    outline: none;
    border-color: var(--primary);
}

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

.custom-input-row input {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid #666;
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
    font-family: inherit;
}

.custom-input-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.3), var(--comic-shadow-sm);
}

.btn-add-custom {
    padding: 12px 20px;
    background: var(--primary);
    color: #fff;
    border: 2px solid #666;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 700;
    box-shadow: var(--comic-shadow-sm);
    font-family: inherit;
}

.btn-add-custom:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.custom-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.custom-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary-bg);
    border: 2px solid #666;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    animation: scaleIn 0.25s ease-out;
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
}

.custom-tag:hover {
    background: #FFF9C4;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
    color: var(--danger);
    transition: color var(--transition);
}

.tag-remove:hover {
    color: var(--danger);
}

/* ─── Note ──────────────────────────────────────────────────────── */
.note-section {
    margin-top: 14px;
    animation: fadeInUp 0.5s ease-out 0.25s both;
}

.note-section textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #666;
    border-radius: var(--radius-sm);
    font-size: 14px;
    resize: none;
    font-family: inherit;
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
}

.note-section textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.3), var(--comic-shadow-sm);
}

/* ─── Cart Bar ──────────────────────────────────────────────────── */
.cart-bar {
    position: fixed;
    bottom: 78px;
    left: 12px;
    right: 12px;
    background: var(--card);
    border: 2px solid #666;
    border-radius: var(--radius);
    box-shadow: var(--comic-shadow-yellow);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 99;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-info {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.cart-detail {
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.cart-count-line {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-count {
    color: var(--primary-dark);
    font-size: 20px;
    font-weight: 700;
    transition: all var(--transition);
}

.cart-count-bounce {
    animation: cartBounce 0.4s ease-out;
}

.btn-submit {
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border: 2px solid #666;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
    font-family: inherit;
    white-space: nowrap;
}

.btn-submit:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* ─── Summary Page ──────────────────────────────────────────────── */
.date-picker {
    margin-bottom: 16px;
    animation: fadeInUp 0.4s ease-out;
}

.date-picker input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #666;
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--card);
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
    font-family: inherit;
}

.date-picker input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.3), var(--comic-shadow-sm);
}

.summary-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-card {
    background: var(--card);
    border: 2px solid #666;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--comic-shadow-yellow);
    animation: fadeInUp 0.4s ease-out both;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(249, 168, 37, 0.03) 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
}

.summary-card:nth-child(1) { animation-delay: 0.05s; }
.summary-card:nth-child(2) { animation-delay: 0.10s; }
.summary-card:nth-child(3) { animation-delay: 0.15s; }
.summary-card:nth-child(4) { animation-delay: 0.20s; }

.summary-card:active {
    transform: scale(0.98);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.member-name {
    font-family: 'Bangers', 'Comic Neue', cursive;
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    letter-spacing: 1px;
}

.meal-badge {
    font-size: 12px;
    background: var(--primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    border: 2px solid #666;
}

.status-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: auto;
    font-weight: 700;
    border: 2px solid #666;
}

.status-pending {
    background: var(--warn);
    color: #fff;
}

.status-sent {
    background: var(--success);
    color: #fff;
}

.card-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.summary-item {
    background: var(--primary-bg);
    border: 2px solid #666;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: all var(--transition);
    box-shadow: 0 1px 3px rgba(249, 168, 37, 0.1);
}

.summary-item:hover {
    background: #FFF9C4;
}

.card-note {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 6px;
    padding-left: 2px;
    position: relative;
    z-index: 1;
}

.card-actions {
    margin-top: 10px;
    text-align: right;
    position: relative;
    z-index: 1;
}

.notify-section {
    margin-top: 24px;
    text-align: center;
    animation: fadeInUp 0.5s ease-out 0.3s both;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: 2px solid #666;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    font-weight: 700;
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
    font-family: inherit;
}

.btn-primary:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.btn-lg {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius);
}

.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-light);
    animation: fadeIn 0.6s ease-out;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* ─── History Page ──────────────────────────────────────────────── */
.filter-bar {
    margin-bottom: 16px;
    animation: fadeInUp 0.4s ease-out;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    background: var(--card);
    border: 2px solid #666;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--comic-shadow-yellow);
    animation: fadeInUp 0.4s ease-out both;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.order-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(249, 168, 37, 0.03) 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
}

.order-card:nth-child(1) { animation-delay: 0.05s; }
.order-card:nth-child(2) { animation-delay: 0.10s; }
.order-card:nth-child(3) { animation-delay: 0.15s; }
.order-card:nth-child(4) { animation-delay: 0.20s; }
.order-card:nth-child(5) { animation-delay: 0.25s; }

.order-card:active {
    transform: scale(0.98);
}

.order-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.order-member {
    font-family: 'Bangers', 'Comic Neue', cursive;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

.order-meal {
    font-size: 12px;
    background: var(--primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    border: 2px solid #666;
}

.order-date {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
}

.order-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.order-item-tag {
    background: var(--primary-bg);
    border: 2px solid #666;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(249, 168, 37, 0.1);
}

.order-note {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    animation: fadeIn 0.5s ease-out 0.3s both;
}

.page-link {
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    border: 2px solid #666;
    background: var(--card);
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
}

.page-link:active {
    transform: translate(1px, 1px);
    box-shadow: none;
}

.page-info {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 600;
}

/* ─── Menu Manage Page ──────────────────────────────────────────── */
.manage-page {
    padding-bottom: 20px;
}

.add-form {
    background: var(--card);
    border: 2px solid #666;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--comic-shadow-yellow);
    animation: fadeInUp 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.add-form::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(249, 168, 37, 0.03) 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
}

.add-form h3 {
    font-family: 'Bangers', 'Comic Neue', cursive;
    font-size: 18px;
    margin-bottom: 14px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.form-row {
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #666;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
    background: var(--card);
    font-family: inherit;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 168, 37, 0.3), var(--comic-shadow-sm);
}

.form-row.inline {
    display: flex;
    gap: 10px;
}

.form-row.inline input {
    flex: 1;
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-row {
    background: var(--card);
    border: 2px solid #666;
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--comic-shadow-yellow);
    animation: fadeInUp 0.4s ease-out both;
    transition: all var(--transition);
}

.item-row:nth-child(1) { animation-delay: 0.05s; }
.item-row:nth-child(2) { animation-delay: 0.08s; }
.item-row:nth-child(3) { animation-delay: 0.11s; }
.item-row:nth-child(4) { animation-delay: 0.14s; }
.item-row:nth-child(5) { animation-delay: 0.17s; }

.item-row:active {
    transform: scale(0.98);
}

.item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-info .item-name {
    font-weight: 700;
    font-size: 15px;
    transition: all var(--transition);
}

.item-info .item-name.disabled {
    text-decoration: line-through;
    color: var(--text-muted);
}

.item-info .item-category {
    font-size: 12px;
    background: var(--primary);
    color: #fff;
    border: 2px solid #666;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 700;
}

.item-actions {
    display: flex;
    gap: 6px;
}

.btn-sm {
    padding: 6px 14px;
    border: 2px solid #666;
    border-radius: var(--radius-xs);
    font-size: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all var(--transition);
    box-shadow: var(--comic-shadow-sm);
    font-family: inherit;
}

.btn-sm:active {
    transform: translate(1px, 1px);
    box-shadow: none;
}

.btn-ok {
    background: var(--success);
    color: #fff;
}

.btn-warn {
    background: var(--warn);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

/* ─── Admin Page ────────────────────────────────────────────────── */
.admin-section {
    background: var(--card);
    border: 2px solid #666;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--comic-shadow-yellow);
    animation: fadeInUp 0.4s ease-out both;
    position: relative;
    overflow: hidden;
}

.admin-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(249, 168, 37, 0.03) 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
}

.admin-section:nth-child(1) { animation-delay: 0.05s; }
.admin-section:nth-child(2) { animation-delay: 0.10s; }
.admin-section:nth-child(3) { animation-delay: 0.15s; }

.admin-section h3 {
    font-family: 'Bangers', 'Comic Neue', cursive;
    font-size: 18px;
    margin-bottom: 14px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.hint {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.config-display {
    background: var(--primary-bg);
    border: 2px solid #666;
    border-radius: var(--radius-sm);
    padding: 14px;
    position: relative;
    z-index: 1;
}

.config-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 2px solid rgba(34, 34, 34, 0.1);
    font-size: 14px;
}

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

.config-label {
    color: var(--text-light);
    font-weight: 600;
}

.config-value {
    font-weight: 700;
    color: var(--text);
}

.member-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--primary-bg);
    border: 2px solid #666;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    animation: fadeInUp 0.3s ease-out both;
    box-shadow: var(--comic-shadow-sm);
}

.member-row:nth-child(1) { animation-delay: 0.05s; }
.member-row:nth-child(2) { animation-delay: 0.08s; }
.member-row:nth-child(3) { animation-delay: 0.11s; }

.member-row:active {
    transform: scale(0.98);
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-info .member-name {
    font-weight: 700;
    display: block;
    color: var(--text);
}

.member-info .member-openid {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #666;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: inherit;
    background: var(--card);
    transition: all var(--transition);
}

.edit-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(249, 168, 37, 0.2);
}

.toggle-label {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    cursor: pointer;
    transition: color var(--transition);
    font-weight: 600;
}

.toggle-label input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 44px;
    height: 24px;
    background: #D7CCC8;
    border: 2px solid #666;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}

.toggle-label input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(249, 168, 37, 0.1);
}

.toggle-label input[type="checkbox"]:checked {
    background: var(--primary);
}

.toggle-label input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

/* ─── Tail List ─────────────────────────────────────────────────── */
.tail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

.tail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    background: var(--primary-bg);
    border: 2px solid #666;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    animation: fadeInUp 0.3s ease-out both;
    box-shadow: var(--comic-shadow-sm);
}

.tail-row:nth-child(1) { animation-delay: 0.05s; }
.tail-row:nth-child(2) { animation-delay: 0.08s; }
.tail-row:nth-child(3) { animation-delay: 0.11s; }

.tail-row:active {
    transform: scale(0.98);
}

.tail-content {
    flex: 1;
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all var(--transition);
    font-weight: 600;
}

.tail-content.disabled {
    text-decoration: line-through;
    color: var(--text-muted);
}

.tail-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ─── Toast ─────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px) scale(0.8);
    background: var(--card);
    border: 2px solid #666;
    box-shadow: var(--comic-shadow);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    z-index: 999;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

.toast::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #666;
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.toast--success .toast-icon { background: var(--success); color: #fff; }
.toast--error .toast-icon { background: var(--danger); color: #fff; }
.toast--warning .toast-icon { background: var(--warn); color: #fff; }
.toast--info .toast-icon { background: var(--primary); color: #fff; }

.toast--success { border-color: var(--success); }
.toast--error { border-color: var(--danger); }
.toast--warning { border-color: var(--warn); }

/* ─── Confirm Dialog ────────────────────────────────────────────── */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-overlay.show {
    opacity: 1;
}

.confirm-dialog {
    background: var(--card);
    border: 2px solid #666;
    border-radius: var(--radius);
    padding: 24px;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 4px 16px rgba(249, 168, 37, 0.2);
    animation: comicPop 0.3s ease-out;
    text-align: center;
}

.confirm-msg {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.confirm-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-confirm-ok {
    padding: 10px 28px;
    background: var(--primary);
    color: #fff;
    border: 2px solid #666;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--comic-shadow-sm);
    transition: all var(--transition);
    font-family: inherit;
}

.btn-confirm-ok:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.btn-confirm-cancel {
    padding: 10px 28px;
    background: var(--card);
    color: var(--text);
    border: 2px solid #666;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--comic-shadow-sm);
    transition: all var(--transition);
    font-family: inherit;
}

.btn-confirm-cancel:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* ─── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
    border: 1px solid #666;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ─── Selection ─────────────────────────────────────────────────── */
::selection {
    background: rgba(249, 168, 37, 0.3);
    color: var(--text);
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 360px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pill-option {
        padding: 6px 12px;
        font-size: 13px;
    }
}
