:root {
    --primary: #28a745;
    --primary-hover: #218838;
    --secondary: #6c757d;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text: #333333;
    --text-secondary: #666666;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #2ea44f;
        --primary-hover: #3cb371;
        --secondary: #8b949e;
        --background: #0d1117;
        --surface: #161b22;
        --text: #c9d1d9;
        --text-secondary: #8b949e;
        --border: #30363d;
        --shadow: rgba(0, 0, 0, 0.3);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

.title {
    text-align: center;
    font-size: 2rem;
    margin: 2rem 0;
    color: var(--text);
}

.layout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.generator-container, .saved-addresses {
    background: var(--surface);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow);
    padding: 2rem;
    height: fit-content;
}

.state-select {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
}

select, button, input {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s;
}

select {
    flex: 1;
    min-width: 200px;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.info-container {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}

.info-row {
    display: flex;
    padding: 0.5rem;
    background: var(--background);
    border-radius: 4px;
    align-items: center;
}

.info-label {
    font-weight: 600;
    min-width: 80px;
    color: var(--text-secondary);
}

.info-value {
    flex: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.info-value:hover {
    background: var(--border);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px var(--shadow);
}

.modal h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

.modal input {
    width: 100%;
    margin-bottom: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.copied {
    position: fixed;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow);
    display: none;
}

.saved-addresses {
    display: flex;
    flex-direction: column;
}

.saved-addresses h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

.saved-table-container {
    flex: 1;
    overflow-y: auto;
    margin: 1rem 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 600px;
}

.saved-table {
    width: 100%;
    border-collapse: collapse;
}

.saved-table th,
.saved-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.saved-table th {
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.delete-btn {
    background: #dc3545;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.delete-btn:hover {
    background: #c82333;
}

.export-btn {
    margin-top: 1rem;
}

.usage-guide {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.usage-guide h4 {
    color: var(--text);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.usage-guide ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.usage-guide li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    padding-left: 1.2rem;
    position: relative;
}

.usage-guide li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.disclaimer {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .title {
        font-size: 1.5rem;
        margin: 1rem 0;
    }

    .layout-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }

    .generator-container, .saved-addresses {
        padding: 1rem;
        border-radius: 0;
    }

    .saved-table {
        display: block;
        width: 100%;
    }

    .saved-table thead {
        display: none;
    }

    .saved-table tbody tr {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 0.5rem;
    }

    .saved-table td {
        display: block;
        width: 100%;
        text-align: right;
        padding: 0.25rem 0;
        border: none;
        white-space: normal;
        word-break: break-word;
    }

    .saved-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: var(--text-secondary);
    }

    .saved-table td[data-label="地址"] {
        padding: 0.5rem 0;
        line-height: 1.4;
    }

    .usage-guide {
        margin-top: 1rem;
        padding: 1rem;
    }

    .usage-guide li {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .state-select {
        flex-direction: column;
        gap: 0.75rem;
    }

    .state-select select {
        width: 100%;
    }

    .state-select button {
        width: 100%;
        height: 44px;
        font-size: 16px;
        margin-top: 0.5rem;
    }
}

.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow);
    animation: fadeInOut 2s ease-in-out forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.ad-container-left,
.ad-container-right {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
}

.ad-container-left {
    left: calc((100% - 1400px) / 2 - 180px);
}

.ad-container-right {
    right: calc((100% - 1400px) / 2 - 180px);
}

@media (max-width: 1560px) {
    .ad-container-left,
    .ad-container-right {
        display: none;
    }
}

.switch-region-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 24px 0 12px 0;
}
.switch-btn {
    background: linear-gradient(90deg, #4f8cff 0%, #6ed0ff 100%);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 8px 28px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79,140,255,0.12);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.switch-btn:not(.active):hover {
    background: linear-gradient(90deg, #6ed0ff 0%, #4f8cff 100%);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 16px rgba(79,140,255,0.18);
}
.switch-btn.active {
    background: linear-gradient(90deg, #ffb347 0%, #ffcc33 100%);
    color: #333;
    cursor: default;
    box-shadow: 0 2px 12px rgba(255,204,51,0.18);
    transform: scale(1.08);
}