/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --font-size-multiplier: 1;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Noto Sans TC', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #111827;
    font-size: calc(15px * var(--font-size-multiplier));
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.page-shell {
    max-width: 100%;
    margin: 0;
    padding: 24px 32px 40px;
}

/* ===== Quick links bar & Header ===== */
.quick-links-bar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.quick-links-bar .container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
}

.quick-links-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-links-label {
    font-weight: 500;
}

.quick-links-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quick-link {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: #f3f4f6;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.quick-link:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.header-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-image {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    object-fit: cover;
}

.logo-section h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.04em;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 16px;
    font-size: 14px;
}

.main-nav a {
    color: #4b5563;
    padding: 4px 0;
}

.main-nav a:hover {
    color: #111827;
}

.header-actions .cta-button {
    border-radius: 999px;
    border: 1px solid #111827;
    background: #111827;
    color: #ffffff;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.header-actions .cta-button:hover {
    background: #ffffff;
    color: #111827;
}

.menu {
    display: none;
}

/* ===== Main layout ===== */
.links-container {
    background: transparent;
    padding: 16px 0 24px;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 40px 20px;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
    border-radius: 20px;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.page-header::after {
    content: '🔗';
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 48px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.page-header h1 {
    font-size: calc(36px * var(--font-size-multiplier));
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0 0 12px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.page-header p {
    color: rgba(255,255,255,0.95);
    font-size: calc(16px * var(--font-size-multiplier));
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 5px rgba(0,0,0,0.15);
}

/* ===== Top toolbar & filters ===== */
.toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0 10px;
    margin-bottom: 8px;
    backdrop-filter: blur(6px);
}

.toolbar-left {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.toolbar-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.font-size-controls {
    display: flex;
    gap: 4px;
    align-items: center;
    padding-left: 8px;
    border-left: 1px solid #e5e7eb;
}

.font-size-controls .action-btn {
    padding: 6px 10px;
    min-width: 32px;
}

.toolbar .search-group {
    flex: 1 1 200px;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: calc(13px * var(--font-size-multiplier));
    color: #6b7280;
}

.toolbar label {
    white-space: nowrap;
}

.toolbar input[type="text"],
.toolbar select {
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: calc(14px * var(--font-size-multiplier));
    flex: 1;
    background: #f9fafb;
    color: #111827;
}

.toolbar input[type="text"]:focus,
.toolbar select:focus {
    outline: none;
    border-color: #111827;
    background: #ffffff;
}

.advanced-toggle-icon {
    font-size: 10px;
}

/* ===== Advanced panel (collapsible) ===== */
.advanced-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.2s ease;
    margin-top: 0;
}

.advanced-panel.is-open {
    max-height: 700px;
    opacity: 1;
    margin-top: 8px;
}

.advanced-panel-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.advanced-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 12px;
}

.advanced-row.single {
    grid-template-columns: minmax(0, 1fr);
}

.export-import-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== Buttons (unified) ===== */
.action-btn,
.add-btn {
    padding: 7px 16px;
    border-radius: 999px;
    font-size: calc(13px * var(--font-size-multiplier));
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.action-btn:hover,
.add-btn:hover {
    background: #111827;
    color: #f9fafb;
    border-color: #111827;
    transform: translateY(-1px);
}

.action-btn.visit {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.action-btn.visit:hover {
    background: #ffffff;
    color: #111827;
}

.action-btn.delete {
    border-color: #f87171;
    color: #b91c1c;
    background: #fef2f2;
}

.action-btn.delete:hover {
    background: #b91c1c;
    color: #ffffff;
    border-color: #b91c1c;
}

/* ===== Category & form panels ===== */
.add-link-section {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 16px;
    border: 1px solid rgba(209, 213, 219, 0.8);
    padding: 18px 16px 16px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.add-link-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #111827;
}

.category-manage {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.category-item-wrapper {
    margin-bottom: 8px;
}

.category-item-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.category-item {
    flex: 1;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid transparent;
    font-size: calc(12px * var(--font-size-multiplier));
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #4b5563;
    min-width: 0;
}

.category-item:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.category-color-select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: calc(11px * var(--font-size-multiplier));
    color: #111827;
    cursor: pointer;
    min-width: 90px;
}

.category-color-select:focus {
    outline: none;
    border-color: #111827;
}

.category-delete-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: calc(11px * var(--font-size-multiplier));
    color: #9ca3af;
    padding: 4px 6px;
    border-radius: 4px;
}

.category-delete-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

.add-link-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 12px;
    color: #6b7280;
}

.form-group input,
.form-group select {
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    background: #f9fafb;
    color: #111827;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #111827;
    background: #ffffff;
}

/* ===== Link cards ===== */
#linksGrid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.link-card {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 16px;
    border: 1px solid rgba(209, 213, 219, 0.8);
    padding: 20px 18px 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    min-height: 140px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.link-card:hover {
    border-color: #111827;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.link-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.link-card-handle {
    cursor: grab;
    margin-right: 4px;
    color: #9ca3af;
    font-size: calc(16px * var(--font-size-multiplier));
    user-select: none;
}

.link-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.link-favicon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.link-info h3 {
    font-size: calc(18px * var(--font-size-multiplier));
    margin: 0 0 4px;
    color: #111827;
    font-weight: 600;
    line-height: 1.3;
}

.link-info p {
    font-size: calc(14px * var(--font-size-multiplier));
    margin: 0;
    color: #6b7280;
    line-height: 1.4;
}

.link-meta {
    margin-top: 6px;
    font-size: calc(12px * var(--font-size-multiplier));
    color: #9ca3af;
}

.link-category {
    margin-right: 8px;
}

.link-pinned {
    color: #f97316;
}

.link-card-header.link-card--blue {
    border-left: 4px solid #2563eb;
    padding-left: 12px;
}

.link-card-header.link-card--green {
    border-left: 4px solid #16a34a;
    padding-left: 12px;
}

.link-card-header.link-card--orange {
    border-left: 4px solid #ea580c;
    padding-left: 12px;
}

.link-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.link-card.drag-over {
    border-color: #111827;
    box-shadow: 0 0 0 1px #111827;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

.empty-state i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 4px;
    color: #111827;
    font-size: 16px;
}

/* ===== Modal (編輯連結) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    width: 100%;
    max-width: 460px;
    padding: 18px 18px 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

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

.modal-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-close-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9ca3af;
    font-size: 16px;
}

.modal-close-btn:hover {
    color: #4b5563;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    border-radius: 10px;
}

.modal .form-group textarea {
    resize: vertical;
    min-height: 60px;
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 13px;
    color: #111827;
}

.modal .form-group textarea:focus {
    outline: none;
    border-color: #111827;
    background: #ffffff;
}

/* ===== 分類分組樣式 ===== */
.category-section {
    margin-top: 32px;
    margin-bottom: 24px;
}

.category-section:first-child {
    margin-top: 0;
}

.category-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 8px;
}

.category-header-line {
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.category-header-title {
    font-size: calc(16px * var(--font-size-multiplier));
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    padding: 0 8px;
    flex-shrink: 0;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #f3f4f6;
}

.category-blue .category-pill {
    background: #dbeafe;
    color: #1d4ed8;
}

.category-green .category-pill {
    background: #dcfce7;
    color: #15803d;
}

.category-orange .category-pill {
    background: #ffedd5;
    color: #c2410c;
}

.category-gray .category-pill {
    background: #e5e7eb;
    color: #4b5563;
}

.category-red .category-pill {
    background: #fee2e2;
    color: #dc2626;
}

.category-purple .category-pill {
    background: #e9d5ff;
    color: #9333ea;
}

.category-yellow .category-pill {
    background: #fef9c3;
    color: #ca8a04;
}

.category-cyan .category-pill {
    background: #cffafe;
    color: #0891b2;
}

.category-pink .category-pill {
    background: #fce7f3;
    color: #db2777;
}

.category-indigo .category-pill {
    background: #e0e7ff;
    color: #6366f1;
}

.category-teal .category-pill {
    background: #ccfbf1;
    color: #0d9488;
}

.category-lime .category-pill {
    background: #ecfccb;
    color: #65a30d;
}

.category-amber .category-pill {
    background: #fef3c7;
    color: #d97706;
}

.category-rose .category-pill {
    background: #ffe4e6;
    color: #e11d48;
}

.category-violet .category-pill {
    background: #ede9fe;
    color: #7c3aed;
}

.category-emerald .category-pill {
    background: #d1fae5;
    color: #059669;
}

.category-sky .category-pill {
    background: #e0f2fe;
    color: #0284c7;
}

.category-fuchsia .category-pill {
    background: #fae8ff;
    color: #c026d3;
}

.category-blue .link-card-header,
.category-green .link-card-header,
.category-orange .link-card-header,
.category-gray .link-card-header,
.category-red .link-card-header,
.category-purple .link-card-header,
.category-yellow .link-card-header,
.category-cyan .link-card-header,
.category-pink .link-card-header,
.category-indigo .link-card-header,
.category-teal .link-card-header,
.category-lime .link-card-header,
.category-amber .link-card-header,
.category-rose .link-card-header,
.category-violet .link-card-header,
.category-emerald .link-card-header,
.category-sky .link-card-header,
.category-fuchsia .link-card-header {
    border-left-width: 4px;
    padding-left: 12px;
}

.category-blue .link-card-header {
    border-left-color: #2563eb;
}

.category-green .link-card-header {
    border-left-color: #16a34a;
}

.category-orange .link-card-header {
    border-left-color: #ea580c;
}

.category-gray .link-card-header {
    border-left-color: #6b7280;
}

.category-red .link-card-header {
    border-left-color: #dc2626;
}

.category-purple .link-card-header {
    border-left-color: #9333ea;
}

.category-yellow .link-card-header {
    border-left-color: #ca8a04;
}

.category-cyan .link-card-header {
    border-left-color: #0891b2;
}

.category-pink .link-card-header {
    border-left-color: #db2777;
}

.category-indigo .link-card-header {
    border-left-color: #6366f1;
}

.category-teal .link-card-header {
    border-left-color: #0d9488;
}

.category-lime .link-card-header {
    border-left-color: #65a30d;
}

.category-amber .link-card-header {
    border-left-color: #d97706;
}

.category-rose .link-card-header {
    border-left-color: #e11d48;
}

.category-violet .link-card-header {
    border-left-color: #7c3aed;
}

.category-emerald .link-card-header {
    border-left-color: #059669;
}

.category-sky .link-card-header {
    border-left-color: #0284c7;
}

.category-fuchsia .link-card-header {
    border-left-color: #c026d3;
}

.category-blue .category-header-line {
    background: #2563eb;
}

.category-green .category-header-line {
    background: #16a34a;
}

.category-orange .category-header-line {
    background: #ea580c;
}

.category-gray .category-header-line {
    background: #6b7280;
}

.category-red .category-header-line {
    background: #dc2626;
}

.category-purple .category-header-line {
    background: #9333ea;
}

.category-yellow .category-header-line {
    background: #ca8a04;
}

.category-cyan .category-header-line {
    background: #0891b2;
}

.category-pink .category-header-line {
    background: #db2777;
}

.category-indigo .category-header-line {
    background: #6366f1;
}

.category-teal .category-header-line {
    background: #0d9488;
}

.category-lime .category-header-line {
    background: #65a30d;
}

.category-amber .category-header-line {
    background: #d97706;
}

.category-rose .category-header-line {
    background: #e11d48;
}

.category-violet .category-header-line {
    background: #7c3aed;
}

.category-emerald .category-header-line {
    background: #059669;
}

.category-sky .category-header-line {
    background: #0284c7;
}

.category-fuchsia .category-header-line {
    background: #c026d3;
}

/* ===== Footer ===== */
footer {
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

footer .container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 16px 18px;
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ===== Theme 1 & Theme 2 ===== */
body.theme-1 {
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%, #e5e7eb 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    color: #111827;
}

body.theme-2 {
    background: #050816;
    color: #e5e7eb;
}

body.theme-1 .links-container {
    border-top: 1px solid #e5e7eb;
}

body.theme-2 .links-container {
    border-top: 1px solid rgba(148, 163, 184, 0.4);
}

body.theme-2 .toolbar {
    background: rgba(15, 23, 42, 0.9);
}

body.theme-1 .toolbar {
    background: linear-gradient(135deg, rgba(243, 244, 246, 0.95), rgba(229, 231, 235, 0.95));
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-bottom-color: rgba(209, 213, 219, 0.6);
}

body.theme-2 .links-grid .link-card {
    background: #020617;
    border-color: rgba(148, 163, 184, 0.4);
}

body.theme-2 .page-header p,
body.theme-2 .link-info p,
body.theme-2 .link-meta {
    color: #000000;
}

body.theme-2 .action-btn,
body.theme-2 .add-btn {
    background: #020617;
    border-color: rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
}

body.theme-2 .action-btn.visit {
    background: #eab308;
    color: #111827;
    border-color: #eab308;
}

body.theme-2 .action-btn.visit:hover {
    background: #fef9c3;
}

body.theme-2 .page-header h1 {
    color: #f9fafb;
}

body.theme-2 .category-header-title {
    color: #e5e7eb;
}

body.theme-2 .link-info h3 {
    color: #f9fafb;
}

body.theme-2 .link-info p {
    color: #cbd5e1;
}

body.theme-2 footer {
    background: #020617;
    border-top-color: rgba(148, 163, 184, 0.4);
}

/* ===== Theme 2: Advanced tools glassmorphism ===== */
body.theme-2 .advanced-panel-inner {
    padding: 14px 12px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(2, 6, 23, 0.95), rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(18px);
}

body.theme-2 .add-link-section {
    background: rgba(15, 23, 42, 0.86);
    border-color: rgba(148, 163, 184, 0.5);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9);
}

body.theme-2 .add-link-section h3 {
    color: #f9fafb;
}

body.theme-2 .add-link-section p,
body.theme-2 .add-link-section label,
body.theme-2 .category-item,
body.theme-2 .category-color-select {
    color: #e5e7eb;
}

body.theme-2 .category-item-row {
    background: rgba(2, 6, 23, 0.85);
    border-color: rgba(148, 163, 184, 0.5);
}

body.theme-2 .category-item {
    background: rgba(2, 6, 23, 0.9);
    border-color: rgba(148, 163, 184, 0.5);
    color: #e5e7eb;
}

body.theme-2 .category-item:hover {
    background: rgba(30, 64, 175, 0.7);
    border-color: rgba(191, 219, 254, 0.9);
}

body.theme-2 .category-color-select {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.6);
}

body.theme-2 .category-color-select:focus {
    border-color: #e5e7eb;
}

body.theme-2 .add-link-form input,
body.theme-2 .add-link-form select,
body.theme-2 .add-link-form textarea,
body.theme-2 .modal .form-group input,
body.theme-2 .modal .form-group textarea,
body.theme-2 .modal .form-group select {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

body.theme-2 .add-link-form input::placeholder,
body.theme-2 .add-link-form textarea::placeholder,
body.theme-2 .modal .form-group input::placeholder,
body.theme-2 .modal .form-group textarea::placeholder {
    color: rgba(148, 163, 184, 0.9);
}

body.theme-2 .add-link-form input:focus,
body.theme-2 .add-link-form textarea:focus,
body.theme-2 .add-link-form select:focus,
body.theme-2 .modal .form-group input:focus,
body.theme-2 .modal .form-group textarea:focus,
body.theme-2 .modal .form-group select:focus {
    outline: none;
    border-color: #e5e7eb;
    box-shadow: 0 0 0 1px rgba(226, 232, 240, 0.25);
}

body.theme-2 #newCategoryName {
    background: rgba(2, 6, 23, 0.95);
    border-color: rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

body.theme-2 #newCategoryName::placeholder {
    color: rgba(148, 163, 184, 0.9);
}

body.theme-2 #newCategoryName:focus {
    outline: none;
    border-color: #e5e7eb;
    box-shadow: 0 0 0 1px rgba(226, 232, 240, 0.25);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .main-nav {
        display: none;
    }

    .add-link-form {
        grid-template-columns: 1fr;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-right {
        justify-content: flex-end;
    }
}

/* ===== 歡迎頁面樣式（全屏設計） ===== */
#welcomeOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

#welcomeOverlay.showing {
    opacity: 1;
}

#welcomeOverlay.hiding {
    opacity: 0;
}

#fireworksContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10000;
}

.celebration-text {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    font-size: calc(28px * var(--font-size-multiplier));
    font-weight: 900;
    color: #FFD700;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 215, 0, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    animation: celebrationPulse 2s ease-in-out infinite;
    white-space: nowrap;
    padding: 0 20px;
    text-align: center;
}

@keyframes celebrationPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scale(1.1);
        opacity: 0.9;
    }
}

.welcome-content-fullscreen {
    position: relative;
    z-index: 10001;
    width: 100%;
    max-width: 1200px;
    padding: 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    animation: welcomeFadeIn 0.8s ease-out;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

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

.welcome-header {
    text-align: center;
}

.welcome-title {
    font-size: calc(36px * var(--font-size-multiplier));
    font-weight: 800;
    color: white;
    margin: 0 0 12px 0;
    text-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.2),
        0 4px 20px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.02em;
}

.welcome-subtitle {
    font-size: calc(16px * var(--font-size-multiplier));
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    line-height: 1.5;
    padding: 0 20px;
}

.welcome-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

.feature-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: default;
    animation: cardFloat 3s ease-in-out infinite;
    box-sizing: border-box;
}

.feature-card:nth-child(1) { animation-delay: 0s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.4s; }
.feature-card:nth-child(4) { animation-delay: 0.6s; }
.feature-card:nth-child(5) { animation-delay: 0.8s; }
.feature-card:nth-child(6) { animation-delay: 1s; }

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon-large {
    font-size: calc(40px * var(--font-size-multiplier));
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.feature-title {
    font-size: calc(18px * var(--font-size-multiplier));
    font-weight: 700;
    color: white;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.feature-desc {
    font-size: calc(13px * var(--font-size-multiplier));
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.welcome-footer {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.welcome-start-btn {
    padding: 14px 40px;
    font-size: calc(18px * var(--font-size-multiplier));
    font-weight: 700;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.welcome-start-btn:hover::before {
    left: 100%;
}

.welcome-start-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.welcome-start-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-icon {
    position: relative;
    z-index: 1;
    font-size: calc(20px * var(--font-size-multiplier));
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.8;
    }
}

/* Theme 2 歡迎頁面樣式 */
body.theme-2 #welcomeOverlay {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

body.theme-2 .welcome-title {
    color: #f1f5f9;
}

body.theme-2 .welcome-subtitle {
    color: rgba(241, 245, 249, 0.9);
}

body.theme-2 .feature-card {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(148, 163, 184, 0.3);
}

body.theme-2 .feature-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.5);
}

body.theme-2 .feature-title {
    color: #f1f5f9;
}

body.theme-2 .feature-desc {
    color: rgba(241, 245, 249, 0.85);
}

body.theme-2 .welcome-start-btn {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(148, 163, 184, 0.4);
}

body.theme-2 .welcome-start-btn:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(148, 163, 184, 0.6);
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .welcome-features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .welcome-content-fullscreen {
        padding: 30px 30px;
        max-width: 100%;
    }

    .celebration-text {
        font-size: calc(24px * var(--font-size-multiplier));
        top: 5%;
    }
}

@media (max-width: 768px) {
    .welcome-content-fullscreen {
        padding: 30px 20px;
        gap: 24px;
        max-width: 100%;
    }

    .welcome-title {
        font-size: calc(28px * var(--font-size-multiplier));
        margin-bottom: 8px;
    }

    .welcome-subtitle {
        font-size: calc(14px * var(--font-size-multiplier));
        padding: 0 10px;
    }

    .welcome-features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-card {
        padding: 18px 14px;
    }

    .feature-icon-large {
        font-size: calc(36px * var(--font-size-multiplier));
        margin-bottom: 10px;
    }

    .feature-title {
        font-size: calc(16px * var(--font-size-multiplier));
        margin-bottom: 6px;
    }

    .feature-desc {
        font-size: calc(12px * var(--font-size-multiplier));
    }

    .welcome-start-btn {
        padding: 12px 32px;
        font-size: calc(16px * var(--font-size-multiplier));
    }

    .celebration-text {
        font-size: calc(20px * var(--font-size-multiplier));
        top: 4%;
        padding: 0 15px;
    }
}

@media (max-height: 800px) {
    .welcome-content-fullscreen {
        padding: 20px 30px;
        gap: 20px;
    }

    .welcome-title {
        font-size: calc(28px * var(--font-size-multiplier));
        margin-bottom: 8px;
    }

    .welcome-subtitle {
        font-size: calc(14px * var(--font-size-multiplier));
        margin-bottom: 0;
    }

    .welcome-features-grid {
        gap: 12px;
    }

    .feature-card {
        padding: 16px 12px;
    }

    .feature-icon-large {
        font-size: calc(32px * var(--font-size-multiplier));
        margin-bottom: 8px;
    }

    .feature-title {
        font-size: calc(16px * var(--font-size-multiplier));
        margin-bottom: 4px;
    }

    .feature-desc {
        font-size: calc(12px * var(--font-size-multiplier));
    }

    .celebration-text {
        font-size: calc(22px * var(--font-size-multiplier));
        top: 4%;
    }
}