/* admin-style.css - 無限延伸捲動版 */

/* 基礎變數 */
:root {
    --bg-dark: #0f0f0f;
    /* 極深背景 */
    --card-bg: #1a1a1a;
    /* 卡片背景 */
    --input-bg: #252525;
    /* 輸入框背景 */
    --input-border: #333333;
    /* 輸入框邊框 */
    --primary-orange: #FF8C00;
    /* 主色調：橘色 */
    --text-main: #ffffff;
    --text-sub: #888888;
}

body {
    background-color: var(--bg-dark);
    font-family: 'Noto Sans TC', sans-serif;
    color: var(--text-main);
}

/* 僅在登入後啟用頁面捲動 */
body.dashboard-mode {
    height: auto !important;
    overflow-y: auto !important;
}

.dashboard-container {
    padding: 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 100px;
    /* 底部留白 */
}

/* 1. Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

.logout-btn:hover {
    background: #444;
}

/* 2. Tabs */
.status-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.tab-btn {
    background: #222;
    color: #888;
    border: 1px solid #333;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary-orange);
    color: #000;
    border-color: var(--primary-orange);
    font-weight: bold;
}

.tab-btn span {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-left: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 3. Form Card (核心新增區) */
.form-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 35px;
    margin-bottom: 15px;
    /* 由 50px 縮減至 15px，更緊湊 */
    border: 1px solid transparent;
}

.card-header {
    margin: 0 0 30px 0;
    color: var(--primary-orange);
    font-size: 1.4rem;
    font-weight: bold;
}

.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group.half {
    width: calc(50% - 13px);
}

.form-group.full {
    width: 100%;
}

label {
    display: flex;
    justify-content: space-between;
    color: var(--text-sub);
    font-size: 1rem;
}

.nav-hint {
    color: #555;
    font-size: 0.85rem;
}

/* 輸入框樣式 */
input[type="text"],
select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 15px;
    color: #fff;
    font-size: 1.1rem;
    outline: none;
    transition: border 0.3s;
}

input[type="text"]:focus,
select:focus {
    border-color: #777;
}

input::placeholder {
    color: #444;
}

/* 新增按鈕 */
.submit-btn {
    width: 100%;
    margin-top: 35px;
    background: var(--primary-orange);
    color: #000;
    font-weight: bold;
    border: none;
    padding: 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: #ff9d24;
}

/* 4. List View (自然延伸版) */
.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* 移除所有高度限制 */
    height: auto;
    overflow: visible;
}

/* 列表項目樣式優化 (長輩友善版) */
.list-item {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 30px;
    /* 特大間距 */
    border-radius: 16px;
    border: 1px solid #333;
    flex-shrink: 0;
    margin-bottom: 5px;
}

.item-img {
    width: 100px;
    /* 特大圖片 */
    height: 100px;
    /* 特大圖片 */
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    margin-right: 30px;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* 行距加大 */
}

.item-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-title {
    color: #FF7043;
    font-weight: bold;
    font-size: 1.6rem;
    /* 特大標題 */
    margin: 0;
}

.status-badge {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    /* 標籤字體加大 */
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.item-link {
    color: #888;
    font-size: 1.1rem;
    /* 網址字體加大 */
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 右側操作區 */
.item-actions {
    display: flex;
    align-items: center;
    gap: 25px;
    /* 加大 */
}

/* 垂直按鈕組 */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.icon-btn {
    padding: 8px 16px;
    /* 按鈕加大 */
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    /* 按鈕文字加大 */
    font-weight: bold;
    color: #fff;
    min-width: 80px;
    text-align: center;
}

.icon-btn.edit {
    background: #4CAF50;
}

.icon-btn.edit:hover {
    background: #43A047;
}

.icon-btn.delete {
    background: #FF5252;
}

.icon-btn.delete:hover {
    background: #FF1744;
}

/* iOS 風格 Toggle Switch (加大版) */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    /* 加寬 */
    height: 34px;
    /* 加高 */
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    /* 滑塊加大 */
    width: 26px;
    /* 滑塊加大 */
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #4CAF50;
}

input:focus+.slider {
    box-shadow: 0 0 1px #4CAF50;
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* 載入中 */
.loading-state {
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 1.2rem;
}

/* 拖拉排序樣式 */
.list-item {
    cursor: grab;
    /* 提示可拖拉 */
}

.list-item:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
    background: #333;
    border: 2px dashed #666;
}

.sortable-chosen {
    background: #2a2a2a;
}