/* 移动端响应式样式 */

/* 中等屏幕 (平板) */
@media (max-width: 1024px) {
    .header {
        padding: 25px 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header-title {
        font-size: 1.6rem;
    }
    
    .main-container {
        gap: 18px;
    }
    
    .panel {
        padding: 22px;
    }
    
    .modal-container {
        max-width: 90%;
        max-height: 85vh;
    }
}

/* 平板和小屏幕笔记本 */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .header {
        padding: 22px 18px;
        margin-bottom: 18px;
        border-radius: 18px;
    }
    
    .header h1 {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }
    
    .header-title {
        font-size: 1.4rem;
    }
    
    .header p {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .main-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .panel {
        min-width: 100%;
        padding: 20px 18px;
        border-radius: 18px;
    }
    
    .panel-header {
        flex-direction: row;
        align-items: center;
        margin-bottom: 20px;
    }
    
    .panel-title {
        font-size: 1.3rem;
        padding-bottom: 10px;
    }
    
    .server-switch-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    input, textarea, select {
        padding: 14px 16px;
        font-size: 1rem;
    }
    
    textarea {
        min-height: 120px;
        font-size: 0.94rem;
    }
    
    .button {
        padding: 14px 20px;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .buttons-row {
        gap: 10px;
        margin-top: 18px;
    }
    
    .result-container {
        padding: 18px;
        border-radius: 18px;
        margin-top: 18px;
    }
    
    .result-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .result-code {
        padding: 16px;
        font-size: 0.9rem;
    }
    
    .copy-btn {
        position: relative;
        top: 0;
        right: 0;
        margin-top: 12px;
        width: 100%;
        padding: 10px 16px;
    }
    
    .config-list {
        max-height: 350px;
    }
    
    .config-item {
        padding: 14px;
        flex-wrap: wrap;
    }
    
    .config-info {
        flex-basis: 100%;
        margin-bottom: 10px;
    }
    
    .config-name {
        font-size: 1.05rem;
        margin-bottom: 5px;
    }
    
    .config-desc {
        font-size: 0.88rem;
    }
    
    .config-details {
        font-size: 0.82rem;
    }
    
    .config-actions {
        justify-content: flex-end;
        flex-basis: 100%;
    }
    
    .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 1.05rem;
    }
    
    .config-status {
        padding: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .current-server-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 8px;
    }
    
    .current-server-name {
        font-size: 1rem;
    }
    
    .current-server-count {
        font-size: 0.8rem;
        padding: 3px 10px;
    }
    
    .refresh-status {
        font-size: 0.84rem;
    }
    
    .test-command {
        padding: 14px;
        font-size: 0.88rem;
    }
    
    .test-command code {
        font-size: 0.86rem;
    }
    
    .test-command ul {
        margin-left: 18px;
        font-size: 0.88rem;
    }
    
    .command-type-indicator {
        font-size: 0.84rem;
        padding: 4px 10px;
        margin-left: 8px;
    }
    
    .example-tabs {
        margin-bottom: 10px;
    }
    
    .example-tab {
        padding: 8px 14px;
        font-size: 0.94rem;
    }
    
    .result-tabs {
        margin-bottom: 14px;
    }
    
    .result-tab {
        padding: 8px 14px;
        font-size: 0.94rem;
    }
    
    .ui-toggle-btn {
        top: 12px;
        right: 12px;
    }
    
    .ui-toggle-btn button {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .proxy-toggle-container {
        padding: 14px;
    }
    
    .proxy-toggle label {
        font-size: 1rem;
    }
    
    .proxy-icon {
        font-size: 1.1rem;
    }
    
    .proxy-select-container {
        padding: 14px;
        max-height: 220px;
    }
    
    .proxy-config-list {
        max-height: 160px;
    }
    
    .proxy-config-item {
        padding: 10px;
    }
    
    .proxy-config-name {
        font-size: 0.94rem;
    }
    
    .proxy-config-desc {
        font-size: 0.8rem;
    }
    
    .proxy-status {
        font-size: 0.84rem;
    }
    
    .proxy-reload-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .proxy-default-badge {
        font-size: 0.65rem;
        padding: 1px 4px;
    }
    
    /* 模态框优化 */
    .modal-overlay {
        padding: 15px;
    }
    
    .modal-container {
        max-width: 95%;
        max-height: 85vh;
        border-radius: 18px;
    }
    
    .modal-header {
        padding: 22px 22px 14px;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .modal-close-btn {
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }
    
    .modal-content {
        padding: 22px;
    }
    
    .modal-section {
        margin-bottom: 20px;
    }
    
    .modal-section label {
        font-size: 1.05rem;
        margin-bottom: 8px;
    }
    
    .modal-select {
        padding: 14px 16px;
        font-size: 1rem;
    }
    
    .server-info-card {
        padding: 18px;
    }
    
    .server-info-header {
        font-size: 1.05rem;
        margin-bottom: 12px;
    }
    
    .server-info-body {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }
    
    .modal-buttons .button {
        width: 100%;
    }
    
    /* 触摸设备优化 */
    .touch-device .button,
    .touch-device .icon-btn,
    .touch-device .copy-btn {
        min-height: 48px;
        min-width: 48px;
    }
    
    .touch-device input,
    .touch-device textarea,
    .touch-device select {
        font-size: 16px !important; /* 防止iOS自动放大 */
    }
    
    .touch-device .config-item,
    .touch-device .proxy-config-item {
        -webkit-user-select: none;
        user-select: none;
    }
    
    .touch-device .config-list,
    .touch-device .proxy-config-list {
        -webkit-overflow-scrolling: touch;
    }
}

/* 手机屏幕 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header {
        padding: 20px 16px;
        margin-bottom: 16px;
        border-radius: 16px;
    }
    
    .header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .header-title {
        font-size: 1.3rem;
        line-height: 1.3;
    }
    
    .header p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .panel {
        padding: 18px 16px;
        border-radius: 16px;
    }
    
    .panel-title {
        font-size: 1.2rem;
    }
    
    .server-switch-btn {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
    
    input, textarea, select {
        padding: 12px 14px;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    textarea {
        min-height: 110px;
        font-size: 0.92rem;
    }
    
    .button {
        padding: 13px 18px;
        font-size: 0.98rem;
        border-radius: 10px;
    }
    
    .buttons-row {
        gap: 8px;
    }
    
    .result-container {
        padding: 16px;
        border-radius: 16px;
        margin-top: 16px;
    }
    
    .result-code {
        padding: 14px;
        font-size: 0.88rem;
    }
    
    .config-list {
        max-height: 320px;
    }
    
    .config-item {
        padding: 12px;
    }
    
    .config-name {
        font-size: 1rem;
    }
    
    .config-desc {
        font-size: 0.86rem;
    }
    
    .config-details {
        font-size: 0.8rem;
    }
    
    .icon-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .speed-result {
        font-size: 0.8rem;
        padding: 3px 8px;
    }
    
    .network-badge {
        font-size: 0.72rem;
        padding: 2px 6px;
    }
    
    .current-server-info {
        font-size: 0.88rem;
    }
    
    .current-server-count {
        font-size: 0.78rem;
        padding: 2px 8px;
    }
    
    .example-tab,
    .result-tab {
        padding: 7px 12px;
        font-size: 0.9rem;
    }
    
    .test-command {
        padding: 12px;
        font-size: 0.86rem;
    }
    
    .test-command code {
        font-size: 0.84rem;
    }
    
    .ui-toggle-btn {
        top: 10px;
        right: 10px;
    }
    
    .ui-toggle-btn button {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
    
    .proxy-toggle label {
        font-size: 0.98rem;
    }
    
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-container {
        max-width: 100%;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 20px 20px 12px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-section {
        margin-bottom: 18px;
    }
    
    .modal-section label {
        font-size: 1rem;
    }
    
    .modal-select {
        padding: 12px 14px;
    }
    
    .server-info-card {
        padding: 16px;
    }
    
    .server-info-header {
        font-size: 1rem;
    }
    
    .server-info-body {
        font-size: 0.92rem;
    }
}

/* 超小屏幕手机 */
@media (max-width: 360px) {
    .header h1 {
        font-size: 1.4rem;
    }
    
    .header-title {
        font-size: 1.2rem;
    }
    
    .header p {
        font-size: 0.92rem;
    }
    
    .panel {
        padding: 16px 14px;
    }
    
    .panel-title {
        font-size: 1.15rem;
    }
    
    .server-switch-btn {
        width: 40px;
        height: 40px;
    }
    
    .button {
        padding: 12px 16px;
        font-size: 0.96rem;
    }
    
    .config-item {
        padding: 10px;
    }
    
    .config-name {
        font-size: 0.98rem;
    }
    
    .config-desc {
        font-size: 0.84rem;
    }
    
    .icon-btn {
        width: 36px;
        height: 36px;
    }
    
    .example-tab,
    .result-tab {
        padding: 6px 10px;
        font-size: 0.88rem;
    }
    
    .modal-header {
        padding: 18px 18px 10px;
    }
    
    .modal-header h3 {
        font-size: 1.15rem;
    }
    
    .modal-close-btn {
        width: 34px;
        height: 34px;
    }
    
    .modal-content {
        padding: 18px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-container {
        max-height: 90vh;
    }
    
    .config-list {
        max-height: 250px;
    }
    
    .proxy-config-list {
        max-height: 120px;
    }
}

/* 深色模式优化 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #e0e0e0;
        --light-gray: #2a2a2a;
        --medium-gray: #404040;
        --white-transparent: rgba(30, 30, 30, 0.9);
        --white-semi-transparent: rgba(30, 30, 30, 0.85);
        --white-extra-transparent: rgba(30, 30, 30, 0.7);
        --acrylic-bg: rgba(40, 40, 40, 0.6);
        --acrylic-border: rgba(80, 80, 80, 0.5);
    }
    
    body {
        background-color: #121212;
    }
    
    .panel {
        background: var(--white-semi-transparent);
    }
    
    .test-command {
        background: rgba(255, 126, 185, 0.15);
    }
    
    .config-status {
        background: rgba(255, 126, 185, 0.15);
    }
    
    .result-code {
        background: rgba(30, 30, 30, 0.9);
    }
    
    .proxy-toggle-container {
        background: rgba(255, 126, 185, 0.08);
    }
    
    .modal-container {
        background: var(--white-semi-transparent);
    }
    
    .server-info-card {
        background: rgba(255, 126, 185, 0.08);
    }
}

/* 打印样式 */
@media print {
    .ui-toggle-btn,
    .server-switch-btn,
    .config-actions,
    .proxy-toggle-container,
    .example-tabs,
    .result-tabs,
    .copy-btn {
        display: none !important;
    }
    
    .container {
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        padding: 0 !important;
    }
    
    .header,
    .panel,
    .result-container {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    .result-code {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }
}