/* ==========================================
 * 全域變數與重設 (Reset & Variables)
 * ========================================== */
:root {
    --bg-gradient: linear-gradient(135deg, #fdfbf7 0%, #ede5d8 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-shadow: 0 10px 30px rgba(94, 58, 31, 0.08);
    --border-color: #e5dac9;
    --text-primary: #382314;
    --text-secondary: #7a5e47;
    --primary-color: #b87b41;
    --primary-hover: #a06732;
    --accent-color: #5e3a1f;
    --pill-bg: #f5eedf;
    --pill-active-bg: #5e3a1f;
    --status-pending: #f5a623;
    --status-completed: #2fb86e;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --font-main: 'Noto Sans TC', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem 1rem 4rem 1rem;
    line-height: 1.6;
}

/* ==========================================
 * 標頭區塊 (Header)
 * ========================================== */
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.app-header .logo {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.app-header .logo span {
    font-size: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    vertical-align: middle;
}

.app-header .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.3rem;
}

/* ==========================================
 * 主版面佈局 (Layout)
 * ========================================== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media(min-width: 768px) {
    .container {
        grid-template-columns: 1.1fr 0.9fr;
    }
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

h2 {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 700;
}

/* ==========================================
 * 表單元件 (Form Elements)
 * ========================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: white;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(184, 123, 65, 0.2);
}

/* 飲品選擇卡片 (Options Grid) */
.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.2rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: white;
    transition: all 0.2s ease;
    user-select: none;
    text-align: center;
}

.option-card input[type="radio"] {
    display: none;
}

.option-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.option-card .name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.option-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.option-card.active {
    border-color: var(--accent-color);
    background: #fbf7f1;
    box-shadow: 0 4px 12px rgba(94, 58, 31, 0.12);
}

/* 膠囊選擇按鈕 (Pills Group) */
.pills-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill {
    padding: 0.5rem 1rem;
    background: var(--pill-bg);
    color: var(--text-secondary);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.pill input[type="radio"] {
    display: none;
}

.pill:hover {
    background: #ebdcc2;
}

.pill.active {
    background: var(--pill-active-bg);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(94, 58, 31, 0.2);
}

/* 杯數控制器 (Quantity Controls) */
.quantity-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 160px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--primary-hover);
}

#quantity {
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: none;
    background: transparent;
    pointer-events: none;
    padding: 0;
}

/* 主按鈕 (Submit Button) */
.primary-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #b87b41 0%, #875525 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(184, 123, 65, 0.3);
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(184, 123, 65, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
 * 訂單列表區塊 (Orders List)
 * ========================================== */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.list-header h2 {
    border: none;
    margin: 0;
    padding: 0;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.icon-btn:hover {
    background: white;
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 550px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* 自訂卷軸 */
.orders-list::-webkit-scrollbar {
    width: 6px;
}
.orders-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.order-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.order-item:hover {
    box-shadow: 0 6px 16px rgba(94, 58, 31, 0.08);
    border-color: #d2c0a6;
}

.order-info .meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.order-info .drink-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.3rem;
}

.order-info .drink-specs {
    font-size: 0.9rem;
    color: #666;
}

.order-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-badge.pending {
    background: #fdf3e1;
    color: var(--status-pending);
    cursor: pointer;
}

.status-badge.completed {
    background: #e4f7ed;
    color: var(--status-completed);
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
}

.empty-state font {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}
