/* =============================================
   生成手机号码下标工具 - 样式
   ============================================= */

/* 选项工具栏 */
.gms-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    row-gap: 6px;
    margin-bottom: 12px;
    background: #f8faff;
    border: 1px solid #e6eeff;
    border-radius: 10px;
    padding: 10px 14px;
}

.gms-option-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    flex: 1;
    min-width: 0;
}

.gms-option-group + .gms-option-group {
    padding-left: 18px;
    border-left: 1px solid #e0e8ff;
    margin-left: 14px;
}

.gms-option-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
    flex-shrink: 0;
}

.gms-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gms-radio {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border: 1.5px solid #d9d9d9;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    user-select: none;
}

.gms-radio:hover {
    border-color: #4096ff;
    background: #e6f4ff;
    color: #1677ff;
}

.gms-radio input[type="radio"] {
    accent-color: #1677ff;
    cursor: pointer;
}

.gms-radio:has(input[type="radio"]:checked) {
    border-color: #1677ff;
    background: #e6f4ff;
    color: #1677ff;
}

.gms-radio input[type="radio"]:checked + span {
    color: #1677ff;
    font-weight: 600;
}

.gms-radio code {
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
}

/* 双列主操作区 */
.gms-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.gms-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.gms-panel--input {
    border-top: 3px solid #4096ff;
}

.gms-panel--output {
    border-top: 3px solid #52c41a;
}

.gms-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 28px;
}

.gms-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.gms-panel-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* 文本域 */
.gms-textarea {
    width: 100%;
    min-height: 240px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.75;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    color: #333;
    background: #fdfdfd;
}

.gms-textarea:focus {
    outline: none;
    border-color: #4096ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.12);
    transform: scale(1.01);
}

.gms-textarea[readonly] {
    background: #f7f9fc;
    color: #1a1a2e;
    cursor: default;
}

/* 文本域底部统计行 */
.gms-footer-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    min-height: 18px;
}

.gms-counter {
    font-size: 12px;
    color: #999;
}

.gms-counter strong {
    color: #1677ff;
    font-weight: 600;
}

/* 中间箭头列 */
.gms-arrow-col {
    display: flex;
    align-items: center;
    padding-top: 42px;
    flex-shrink: 0;
}

.gms-arrow {
    font-size: 26px;
    color: #d0d0d0;
    line-height: 1;
    transition: color 0.3s, transform 0.3s;
}

.gms-arrow.active {
    color: #1677ff;
    transform: scale(1.15);
}

/* 操作行 */
.gms-action-row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 6px;
    margin-bottom: 6px;
}

.gms-shortcut-tip {
    font-size: 12px;
    color: #aaa;
    margin-left: 10px;
}

/* 查找区域 */
.gms-search-section {
    margin-top: 14px;
    background: #fafbff;
    border: 1px solid #e6eeff;
    border-top: 3px solid #722ed1;
    border-radius: 10px;
    padding: 12px 14px;
    animation: gmsFadeIn 0.28s ease;
}

.gms-search-header {
    margin-bottom: 8px;
}

.gms-search-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.gms-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.gms-search-input {
    flex: 1;
    max-width: 280px;
    padding: 6px 12px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
    border: 1.5px solid #d9d9d9;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    box-sizing: border-box;
}

.gms-search-input:focus {
    outline: none;
    border-color: #4096ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.12);
    transform: scale(1.01);
}

.gms-search-btn {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.gms-search-result {
    margin-top: 8px;
}

.gms-search-tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
}

.gms-search-tag--success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

.gms-search-tag--fail {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
}

/* 下标明细表格区 */
.gms-table-section {
    margin-top: 14px;
    animation: gmsFadeIn 0.28s ease;
}

@keyframes gmsFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gms-table-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.gms-table-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.gms-table-summary {
    font-size: 12px;
    color: #666;
}

.gms-table-summary strong {
    color: #1677ff;
}

.gms-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    scroll-behavior: smooth;
}

.gms-table-wrap::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.gms-table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.gms-table-wrap::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.gms-table-wrap::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.gms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.gms-table th {
    background: #f5f7fa;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e8e8e8;
    white-space: nowrap;
}

.gms-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Consolas', 'Monaco', monospace;
}

.gms-table tr {
    transition: background 0.15s;
}

.gms-table tr:last-child td {
    border-bottom: none;
}

.gms-table tr:hover td {
    background: #f0f7ff;
}

.gms-row-found td {
    background: #fffbe6 !important;
    animation: gmsRowHighlight 0.45s ease;
}

.gms-row-found td:first-child {
    border-left: 3px solid #faad14;
    padding-left: 9px;
}

.gms-row-found .gms-badge {
    background: #faad14;
    color: #fff;
}

.gms-row-found:hover td {
    background: #fff1b8 !important;
}

@keyframes gmsRowHighlight {
    0%   { background: #ffe58f !important; }
    100% { background: #fffbe6 !important; }
}

.gms-col-subscript {
    width: 70px;
    text-align: center;
}

.gms-col-mobile {
    min-width: 120px;
}

.gms-col-format {
    min-width: 150px;
}

.gms-col-result {
    color: #595959;
}

.gms-col-action {
    width: 80px;
    text-align: center;
}

/* 下标徽章 */
.gms-badge {
    display: inline-block;
    min-width: 32px;
    padding: 2px 8px;
    background: #e6f4ff;
    color: #1677ff;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    font-family: 'Consolas', 'Monaco', monospace;
    transition: background 0.25s, color 0.25s;
}

/* 单行复制按钮 */
.gms-copy-btn {
    padding: 2px 8px;
    font-size: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.gms-copy-btn:hover {
    border-color: #4096ff;
    color: #1677ff;
    background: #e6f4ff;
    transform: scale(1.02);
}

.gms-search-btn:hover {
    transform: scale(1.02);
}

.gms-copy-btn.copied {
    border-color: #52c41a;
    color: #52c41a;
    background: #f6ffed;
}

/* 提交按钮禁用状态 */
#processBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 剪贴板辅助元素 */
.gms-clipboard-tmp {
    position: fixed;
    top: -9999px;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

/* 无效提示（JS控制显隐） */
.gms-hint-hidden {
    display: none;
}

.gms-invalid-hint {
    font-size: 12px;
    color: #fa8c16;
}

/* Toast 通知 */
.gms-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 9px 16px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.gms-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.gms-toast--success {
    background: rgba(82, 196, 26, 0.92);
}

.gms-toast--warning {
    background: rgba(250, 173, 20, 0.92);
    color: #333;
}

.gms-toast--error {
    background: rgba(255, 77, 79, 0.92);
}

/* 响应式 —— 平板端 */
@media (max-width: 768px) {
    .gms-toolbar {
        flex-direction: column;
        gap: 8px;
    }

    .gms-option-group + .gms-option-group {
        padding-left: 0;
        border-left: none;
        margin-left: 0;
        padding-top: 8px;
        border-top: 1px solid #eee;
    }

    .gms-main {
        flex-direction: column;
    }

    .gms-arrow-col {
        padding-top: 0;
        justify-content: center;
    }

    .gms-arrow {
        transform: rotate(90deg);
    }

    .gms-arrow.active {
        transform: rotate(90deg) scale(1.15);
    }

    .gms-search-row {
        flex-wrap: wrap;
    }

    .gms-search-input {
        max-width: 100%;
    }

    .gms-table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .gms-col-action {
        display: none;
    }

    .gms-table td,
    .gms-table th {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* 响应式 —— 手机端（强制单列） */
@media (max-width: 640px) {
    .gms-toolbar {
        flex-direction: column;
        gap: 6px;
        padding: 8px 10px;
    }

    .gms-option-group + .gms-option-group {
        padding-left: 0;
        border-left: none;
        margin-left: 0;
        padding-top: 6px;
        border-top: 1px solid #eee;
    }

    .gms-main {
        flex-direction: column;
        gap: 8px;
    }

    .gms-arrow-col {
        padding-top: 0;
        justify-content: center;
    }

    .gms-arrow {
        transform: rotate(90deg);
    }

    .gms-arrow.active {
        transform: rotate(90deg) scale(1.15);
    }

    .gms-radio-group {
        gap: 4px;
    }

    .gms-radio {
        padding: 3px 8px;
        font-size: 11px;
    }

    .gms-search-row {
        flex-wrap: wrap;
    }

    .gms-search-input {
        max-width: 100%;
        flex: 1;
    }

    .gms-col-action {
        display: none;
    }

    .gms-table td,
    .gms-table th {
        padding: 5px 7px;
        font-size: 12px;
    }
}
