*{margin:0;padding:0;box-sizing:border-box}:root{--bg-color:#f8fafc;--card-bg:#ffffff;--text-color:#1e293b;--border-color:#e2e8f0;--primary-color:#34d399;--hover-color:#10b981;--secondary-color:#1e293b;--muted-bg:#f0fdf4;--muted-hover:#dcfce7;--success-color:#34d399;--input-bg:#ffffff}[data-theme=dark]{--bg-color:#0f172a;--card-bg:#111827;--text-color:#e5e7eb;--border-color:#1f2937;--primary-color:#34d399;--hover-color:#10b981;--secondary-color:#cbd5e1;--muted-bg:#1f2937;--muted-hover:#273449;--success-color:#34d399;--input-bg:#0f172a}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei','PingFang SC','DejaVu Sans',sans-serif;background:var(--bg-color);color:var(--text-color);transition:background-color .3s,color .3s;padding:10px 10px 70px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.container{max-width:1400px;margin:0 auto}.main-section{display:none}.main-section.active{display:block}.header{background:var(--card-bg);padding:15px;border-radius:10px;margin-bottom:15px;box-shadow:0 2px 10px rgba(0,0,0,.1);display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px}.header h1{color:var(--primary-color);font-size:20px;font-weight:600}.header-controls{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.theme-toggle{padding:10px 16px;background:var(--primary-color);color:#fff;border:none;border-radius:2px;cursor:pointer;font-size:14px;transition:background .2s,transform .1s;min-height:44px;touch-action:manipulation}.theme-toggle:active,.theme-toggle:hover{background:var(--hover-color);transform:scale(1.02)}.input-section{background:var(--card-bg);padding:15px;border-radius:10px;margin-bottom:15px;box-shadow:0 2px 10px rgba(0,0,0,.1)}.input-section label{display:block;margin-bottom:10px;font-size:14px}.input-section textarea{width:100%;min-height:120px;padding:12px;border:2px solid var(--border-color);border-radius:2px;background:var(--input-bg);color:var(--text-color);font-size:14px;resize:vertical;font-family:monospace;appearance:none;-webkit-appearance:none}.input-section textarea:focus{outline:0;border-color:var(--primary-color)}.tabs-wrapper{background:var(--card-bg);padding:10px;border-radius:10px;margin-bottom:15px;box-shadow:0 2px 10px rgba(0,0,0,.1);overflow-x:auto;overflow-y:hidden;position:relative;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none;touch-action:pan-x pinch-zoom;width:100%;max-width:100%}.tabs-wrapper::after{content:'';position:absolute;right:0;top:0;bottom:0;width:40px;pointer-events:none;background:linear-gradient(90deg,rgba(255,255,255,0) 0,var(--card-bg) 100%)}.tabs{display:flex;gap:8px;min-width:100%;width:max-content;padding-bottom:5px;flex-wrap:nowrap;position:relative}.tabs::-webkit-scrollbar{display:none}.tab{padding:12px 16px;background:var(--bg-color);border:2px solid var(--border-color);border-radius:5px;cursor:pointer;transition:all .3s;font-size:13px;white-space:nowrap;min-height:44px;display:flex;align-items:center;touch-action:manipulation;user-select:none;scroll-snap-align:start;font-weight:600;box-shadow:0 1px 3px rgba(0,0,0,.05);flex-shrink:0;min-width:fit-content}.tab:active{transform:scale(.98)}.tab:hover{background:var(--border-color)}.tab.active{background:var(--primary-color);color:#fff;border-color:var(--primary-color);box-shadow:0 6px 12px rgba(102,126,234,.3)}.tab-content{display:none;background:var(--card-bg);padding:15px;border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,.1);margin-bottom:15px;animation:fadeCard .3s ease}.tab-content.active{display:block}@keyframes fadeCard{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.tab-content h2{font-size:18px;margin-bottom:15px;color:var(--primary-color)}.filter-section{margin-bottom:15px}.filter-section label{display:block;margin-bottom:8px;font-weight:600;font-size:14px}.filter-section input[type=email],.filter-section input[type=number],.filter-section input[type=search],.filter-section input[type=tel],.filter-section input[type=text],.filter-section select{width:100%;padding:12px;border:2px solid var(--border-color);border-radius:5px;background:var(--input-bg);color:var(--text-color);font-size:14px;appearance:none;-webkit-appearance:none;min-height:44px}.filter-section input:focus,.filter-section select:focus{outline:0;border-color:var(--primary-color)}.checkbox-group{display:flex;align-items:center;gap:8px;margin:10px 0;cursor:pointer;min-height:44px}.checkbox-group.compact{min-height:unset;margin:0;font-size:13px}.checkbox-group input[type=checkbox]{width:20px;height:20px;cursor:pointer;min-height:auto}.flag-checkbox{width:18px;height:18px;vertical-align:middle;margin-right:4px;cursor:pointer}.checkbox-group.compact span{line-height:20px;display:inline-block}.btn{padding:12px 20px;background:var(--primary-color);color:#fff;border:none;border-radius:2px;cursor:pointer;font-size:14px;transition:background .2s,transform .1s;margin:5px 5px 5px 0;min-height:44px;touch-action:manipulation;user-select:none;-webkit-tap-highlight-color:transparent}.btn:active{transform:scale(.98)}.btn:hover{background:var(--hover-color);transform:scale(1.02)}.btn-secondary{background:#f0fdf4;color:#34d399;border:1px solid #34d399}.btn-secondary:hover{background:#dcfce7;color:#10b981;border-color:#10b981}.btn-secondary.ghost{background:0 0;color:var(--primary-color);border:1px dashed var(--primary-color)}.btn-secondary.ghost:hover{background:rgba(102,126,234,.1)}.btn-success{background:var(--success-color)}.btn-success:hover{background:#45a049}.result-table-wrapper{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.result-table{width:100%;border-collapse:collapse;margin-top:15px;font-size:14px;display:table}.result-table thead{display:table;width:100%;table-layout:fixed}.result-table tbody{display:table;width:100%;table-layout:fixed;max-height:400px;overflow-y:auto}.result-table td,.result-table th{padding:10px 8px;text-align:left;border-bottom:1px solid var(--border-color);word-break:break-word}.result-table th{background:var(--primary-color);color:#fff;font-weight:600;position:sticky;top:0;z-index:10}.result-table tr:hover{background:var(--bg-color)}.result-list{max-height:500px;overflow-y:auto;margin-top:15px;-webkit-overflow-scrolling:touch}.result-item{padding:12px;border-bottom:1px solid var(--border-color);display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;font-size:14px}.result-item:hover{background:var(--bg-color)}.threshold-input{display:inline-block;width:100px;margin:0 10px;padding:10px;border:2px solid var(--border-color);border-radius:2px;background:var(--input-bg);color:var(--text-color);font-size:14px;min-height:44px}.alert{padding:12px;border-radius:2px;margin:15px 0;background:#fffbeb;color:#f59e0b;border:1px solid #fde68a;font-size:14px}[data-theme=dark] .alert{background:#3b2a05;color:#fcd34d;border-color:#b45309}.success-message{position:fixed;top:20px;right:20px;background:var(--success-color);color:#fff;padding:15px 20px;border-radius:5px;box-shadow:0 4px 12px rgba(0,0,0,.3);z-index:1000;animation:slideIn .3s;font-size:14px;max-width:calc(100vw - 40px)}@keyframes slideIn{from{transform:translateX(100%);opacity:0}to{transform:translateX(0);opacity:1}}.position-filter-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:15px;margin-bottom:15px}.position-select-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:15px;margin-bottom:20px}.position-card{border:1px solid var(--border-color);border-radius:10px;padding:15px;background:var(--bg-color)}.position-card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;font-weight:600;color:var(--primary-color)}.digit-checkbox-grid{display:grid;grid-template-columns:repeat(5,minmax(40px,1fr));gap:8px;margin-bottom:15px}.repeat-type-grid{grid-template-columns:1fr}.span-checkbox-grid{display:grid;grid-template-columns:repeat(7,minmax(40px,1fr));gap:8px;margin-bottom:15px}.digit-checkbox{display:flex;align-items:center;justify-content:center;border:1px solid var(--border-color);border-radius:8px;padding:6px 0;cursor:pointer;user-select:none;transition:border-color .2s,background .2s,color .2s;font-weight:600;font-size:14px;color:var(--text-color)}.digit-checkbox input{display:none}.digit-checkbox span{pointer-events:none}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:var(--primary-color)}.digit-checkbox input:checked+span::after,.digit-checkbox input:checked~span::after{content:''}.digit-checkbox input:checked,.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{font-weight:700}.digit-checkbox input:checked+span::before,.digit-checkbox input:checked~span::before{content:''}.digit-checkbox input:checked,.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked{border-color:var(--primary-color)}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:var(--card-bg)}.digit-checkbox input:checked~span{background:0 0}.digit-checkbox input:checked~span::before{content:''}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked{background:var(--primary-color)}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked{background:var(--primary-color);border-color:var(--primary-color)}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.digit-checkbox input:checked+span,.digit-checkbox input:checked~span{color:#fff}.code-combination{display:inline-block;padding:8px 12px;background:var(--primary-color);color:#fff;border-radius:5px;margin:5px;font-size:14px}.history-item{padding:15px;border:1px solid var(--border-color);border-radius:5px;margin-bottom:15px;background:var(--bg-color)}.history-item h4{color:var(--primary-color);margin-bottom:10px;font-size:16px}.history-item .time{color:#999;font-size:12px;margin-bottom:10px}.history-item div{font-size:14px;line-height:1.6}.function-select-bar{display:flex;align-items:center;gap:10px;margin:10px 0 15px;flex-wrap:wrap}.function-add-btn{min-width:110px}.function-hint{font-size:13px;color:#888}.filter-mode-toggle{margin:10px 0 15px}.break-rules-summary,.rules-summary{margin-top:10px;font-size:13px;line-height:1.6}.break-rules-list,.rules-list{margin-top:8px;padding-left:4px}.break-rule-item,.rule-item{margin-bottom:4px}.bottom-nav{position:fixed;left:0;right:0;bottom:0;background:var(--card-bg);border-top:1px solid var(--border-color);display:flex;justify-content:space-around;padding:6px 0 4px;z-index:100}.bottom-nav button{flex:1;background:0 0;border:none;font-size:13px;color:var(--text-color);padding:6px 0;cursor:pointer;border-radius:2px}.bottom-nav button:focus{outline:0}.bottom-nav button:hover{background:rgba(0,0,0,.02)}.function-menu-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);display:none;align-items:center;justify-content:center;z-index:200}.function-menu-overlay.active{display:flex}.function-menu{background:var(--card-bg);padding:16px;border-radius:10px;max-width:360px;width:90%;box-shadow:0 6px 18px rgba(0,0,0,.25)}.function-menu h3{margin-bottom:12px;font-size:16px;color:var(--primary-color)}.function-menu-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:10px}.function-menu-list .btn{width:100%;margin:0}.final-actions-panel,.final-output-panel{background:var(--card-bg);padding:15px;border-radius:10px;margin-bottom:15px;box-shadow:0 2px 10px rgba(0,0,0,.1)}.actions-log{max-height:260px;overflow-y:auto;margin-bottom:12px}.final-actions-buttons{display:flex;gap:10px;flex-wrap:wrap}.final-actions-buttons .btn{flex:1}.final-result .result-item{align-items:flex-start}@media (max-width:768px){body{padding:8px 8px 70px}.bottom-nav button{font-size:12px;padding:8px 0}.function-menu{max-width:320px;padding:14px}.function-menu-list{grid-template-columns:1fr}}.filter-mode-toggle{margin:10px 0 15px}.flex-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.flex-row input{flex:1;min-width:150px}.span-input{flex:0 0 260px;max-width:260px}@media (max-width:768px){.span-input{flex:1;max-width:100%}}.digit-checkbox{position:relative;border:none;padding:0}.digit-checkbox input{position:absolute;opacity:0;pointer-events:none}.digit-checkbox span{display:block;width:100%;text-align:center;padding:8px 0;border:1px solid var(--muted-bg);border-radius:8px;font-weight:600;font-size:14px;color:#34d399;background:var(--muted-bg);transition:background .2s,color .2s,border-color .2s,box-shadow .2s}.digit-checkbox:hover span{border-color:var(--muted-hover);background:var(--muted-hover);color:#10b981}.digit-checkbox input:checked+span{background:var(--primary-color);border-color:var(--primary-color);color:#fff;box-shadow:0 4px 10px rgba(16,185,129,.25);border:1px solid #10b981}@media (max-width:768px){body{padding:8px}.header{padding:12px;flex-direction:column;align-items:flex-start}.header h1{font-size:18px}.header-controls{width:100%;justify-content:space-between}.input-section{padding:12px}.input-section textarea{font-size:16px}.tabs-wrapper{padding:8px;margin-left:-8px;margin-right:-8px;border-radius:0;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;touch-action:pan-x pinch-zoom;width:100vw;position:relative;left:0;right:0}.tabs-wrapper::after{display:none}.tabs{gap:6px;width:max-content;min-width:100%;flex-wrap:nowrap;display:flex}.tab{padding:10px 12px;font-size:12px}.tab-content{padding:12px}.tab-content h2{font-size:16px}.result-table{font-size:12px}.result-table td,.result-table th{padding:8px 6px}.result-item{flex-direction:column;align-items:flex-start;padding:10px}.position-filter-grid{grid-template-columns:1fr}.flex-row{flex-direction:column;align-items:stretch}.flex-row input{min-width:100%}.threshold-input{width:100%;margin:10px 0}.btn{width:100%;margin:5px 0}.success-message{right:10px;left:10px;max-width:none}}@media (max-width:480px){.header h1{font-size:16px}.tab{padding:8px 10px;font-size:11px}.result-table{font-size:11px}.code-combination{display:block;margin:5px 0}}@media (max-width:768px) and (orientation:landscape){.tabs-wrapper{max-height:200px}.result-list{max-height:300px}}@media (min-width:1024px){.tabs-wrapper::after{display:none}}